Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Change the default API request on the home page to the much smaller ditto (16 kB), from bulbasaur (290 kB). - Remove bits of ditto to shorten to 6 kB, then immediately fire off a request when the page loads to get the complete data. - Change the way JsonViewer is rendered so that only the bits that are visible are output. This cuts down the size of the initial HTML in half. - Add a fetch polyfill (whatwg-fetch)
- Loading branch information
Showing
7 changed files
with
321 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import 'whatwg-fetch'; | ||
|
||
export default { | ||
onClientEntry: () => { | ||
// Don't need to do anything here, but if you don't | ||
// export something, the import won't work. | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,263 @@ | ||
{ | ||
"abilities": [ | ||
{ | ||
"ability": { | ||
"name": "imposter", | ||
"url": "https://pokeapi.co/api/v2/ability/150/" | ||
}, | ||
"is_hidden": true, | ||
"slot": 3 | ||
}, | ||
{ | ||
"ability": { | ||
"name": "limber", | ||
"url": "https://pokeapi.co/api/v2/ability/7/" | ||
}, | ||
"is_hidden": false, | ||
"slot": 1 | ||
} | ||
], | ||
"base_experience": 101, | ||
"forms": [ | ||
{ | ||
"name": "ditto", | ||
"url": "https://pokeapi.co/api/v2/pokemon-form/132/" | ||
} | ||
], | ||
"game_indices": [ | ||
{ | ||
"game_index": 132, | ||
"version": { | ||
"name": "black-2", | ||
"url": "https://pokeapi.co/api/v2/version/21/" | ||
} | ||
}, | ||
{ | ||
"game_index": 132, | ||
"version": { | ||
"name": "black", | ||
"url": "https://pokeapi.co/api/v2/version/17/" | ||
} | ||
}, | ||
{ | ||
"game_index": 132, | ||
"version": { | ||
"name": "heartgold", | ||
"url": "https://pokeapi.co/api/v2/version/15/" | ||
} | ||
}, | ||
{ | ||
"game_index": 132, | ||
"version": { | ||
"name": "pearl", | ||
"url": "https://pokeapi.co/api/v2/version/13/" | ||
} | ||
}, | ||
{ | ||
"game_index": 132, | ||
"version": { | ||
"name": "firered", | ||
"url": "https://pokeapi.co/api/v2/version/10/" | ||
} | ||
}, | ||
{ | ||
"game_index": 132, | ||
"version": { | ||
"name": "ruby", | ||
"url": "https://pokeapi.co/api/v2/version/7/" | ||
} | ||
}, | ||
{ | ||
"game_index": 132, | ||
"version": { | ||
"name": "gold", | ||
"url": "https://pokeapi.co/api/v2/version/4/" | ||
} | ||
}, | ||
{ | ||
"game_index": 76, | ||
"version": { | ||
"name": "red", | ||
"url": "https://pokeapi.co/api/v2/version/1/" | ||
} | ||
} | ||
], | ||
"height": 3, | ||
"held_items": [ | ||
{ | ||
"item": { | ||
"name": "metal-powder", | ||
"url": "https://pokeapi.co/api/v2/item/234/" | ||
}, | ||
"version_details": [ | ||
{ | ||
"rarity": 5, | ||
"version": { | ||
"name": "moon", | ||
"url": "https://pokeapi.co/api/v2/version/28/" | ||
} | ||
}, | ||
{ | ||
"rarity": 5, | ||
"version": { | ||
"name": "x", | ||
"url": "https://pokeapi.co/api/v2/version/23/" | ||
} | ||
}, | ||
{ | ||
"rarity": 5, | ||
"version": { | ||
"name": "black-2", | ||
"url": "https://pokeapi.co/api/v2/version/21/" | ||
} | ||
}, | ||
{ | ||
"rarity": 5, | ||
"version": { | ||
"name": "black", | ||
"url": "https://pokeapi.co/api/v2/version/17/" | ||
} | ||
}, | ||
{ | ||
"rarity": 5, | ||
"version": { | ||
"name": "heartgold", | ||
"url": "https://pokeapi.co/api/v2/version/15/" | ||
} | ||
}, | ||
{ | ||
"rarity": 5, | ||
"version": { | ||
"name": "diamond", | ||
"url": "https://pokeapi.co/api/v2/version/12/" | ||
} | ||
}, | ||
{ | ||
"rarity": 5, | ||
"version": { | ||
"name": "firered", | ||
"url": "https://pokeapi.co/api/v2/version/10/" | ||
} | ||
}, | ||
{ | ||
"rarity": 5, | ||
"version": { | ||
"name": "ruby", | ||
"url": "https://pokeapi.co/api/v2/version/7/" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"id": 132, | ||
"is_default": true, | ||
"location_area_encounters": "https://pokeapi.co/api/v2/pokemon/132/encounters", | ||
"moves": [ | ||
{ | ||
"move": { | ||
"name": "transform", | ||
"url": "https://pokeapi.co/api/v2/move/144/" | ||
}, | ||
"version_group_details": [ | ||
{ | ||
"level_learned_at": 1, | ||
"move_learn_method": { | ||
"name": "level-up", | ||
"url": "https://pokeapi.co/api/v2/move-learn-method/1/" | ||
}, | ||
"version_group": { | ||
"name": "yellow", | ||
"url": "https://pokeapi.co/api/v2/version-group/2/" | ||
} | ||
}, | ||
{ | ||
"level_learned_at": 1, | ||
"move_learn_method": { | ||
"name": "level-up", | ||
"url": "https://pokeapi.co/api/v2/move-learn-method/1/" | ||
}, | ||
"version_group": { | ||
"name": "red-blue", | ||
"url": "https://pokeapi.co/api/v2/version-group/1/" | ||
} | ||
} | ||
] | ||
} | ||
], | ||
"name": "ditto", | ||
"order": 195, | ||
"species": { | ||
"name": "ditto", | ||
"url": "https://pokeapi.co/api/v2/pokemon-species/132/" | ||
}, | ||
"sprites": { | ||
"back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/132.png", | ||
"back_female": null, | ||
"back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/132.png", | ||
"back_shiny_female": null, | ||
"front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/132.png", | ||
"front_female": null, | ||
"front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/132.png", | ||
"front_shiny_female": null | ||
}, | ||
"stats": [ | ||
{ | ||
"base_stat": 48, | ||
"effort": 0, | ||
"stat": { | ||
"name": "speed", | ||
"url": "https://pokeapi.co/api/v2/stat/6/" | ||
} | ||
}, | ||
{ | ||
"base_stat": 48, | ||
"effort": 0, | ||
"stat": { | ||
"name": "special-defense", | ||
"url": "https://pokeapi.co/api/v2/stat/5/" | ||
} | ||
}, | ||
{ | ||
"base_stat": 48, | ||
"effort": 0, | ||
"stat": { | ||
"name": "special-attack", | ||
"url": "https://pokeapi.co/api/v2/stat/4/" | ||
} | ||
}, | ||
{ | ||
"base_stat": 48, | ||
"effort": 0, | ||
"stat": { | ||
"name": "defense", | ||
"url": "https://pokeapi.co/api/v2/stat/3/" | ||
} | ||
}, | ||
{ | ||
"base_stat": 48, | ||
"effort": 0, | ||
"stat": { | ||
"name": "attack", | ||
"url": "https://pokeapi.co/api/v2/stat/2/" | ||
} | ||
}, | ||
{ | ||
"base_stat": 48, | ||
"effort": 1, | ||
"stat": { | ||
"name": "hp", | ||
"url": "https://pokeapi.co/api/v2/stat/1/" | ||
} | ||
} | ||
], | ||
"types": [ | ||
{ | ||
"slot": 1, | ||
"type": { | ||
"name": "normal", | ||
"url": "https://pokeapi.co/api/v2/type/1/" | ||
} | ||
} | ||
], | ||
"weight": 40 | ||
} |
Oops, something went wrong.