andreferreiradlw / pokestats Goto Github PK
View Code? Open in Web Editor NEWThe Pokédex powered by PokeApi
Home Page: https://pokestats.gg
License: MIT License
The Pokédex powered by PokeApi
Home Page: https://pokestats.gg
License: MIT License
Created this issue to refactor the current existing code in pokeapi-sw.js based on the pokeapi-js-wrapped service worker.
The objective here is to create code consistency between this logic and the rest of the Workbox routes. When I tried to emplement similar logic with Workbox, the service worker is saving all the opaque
responses and thus, generating massive cache sizes and quickly filling the storage quota.
When I try to filter out the opaque responses that have status code 0
with Workbox's CacheableResponsePlugin, even though the image responses return with status code 200
, they are not getting cached.
Pokeapi serves data just as it is scraped from the Nintendo Pokemon ROMs. Thus sometimes it contains some hidden strange characters which were used as a hack to separate text.
Specifically, in the details pane, you are rendering the flavor text for a specific Pokemon. These almost always contain that char. Browsers render it as an arrow pointing up.
You can use this code to get rid of this annoyance:
# Page breaks are treated just like newlines.
# Soft hyphens followed by newlines vanish.
# Letter-hyphen-newline becomes letter-hyphen, to preserve real
# hyphenation.
# Any other newline becomes a space.
html = flavor_text.replace(u'\f', u'\n') \
.replace(u'\u00ad\n', u'') \
.replace(u'\u00ad', u'') \
.replace(u' -\n', u' - ') \
.replace(u'-\n', u'-') \
.replace(u'\n', u' ')
Reference:
This is just a suggestion.
This project caught my eyes, it's very neat and provides a lot of info. I was thinking that maybe you could use https://github.com/PokeAPI/pokeapi-js-wrapper and especially its feature to cache images:
https://github.com/PokeAPI/pokeapi-js-wrapper#caching-images
Just enabling the SW without actually using the wrapper would be a huge benefit for subsequent page loadings.
Showcasing 25(?) at a time with a current maximum of 151 Pokemons.
Submit the first recommended Pokémon.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.