Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamically import ability, item, hero data #338

Open
blukai opened this issue Oct 25, 2016 · 5 comments
Open

dynamically import ability, item, hero data #338

blukai opened this issue Oct 25, 2016 · 5 comments

Comments

@blukai
Copy link
Member

blukai commented Oct 25, 2016

https://github.com/odota/ui/blob/master/src/components/Visualizations/inflictorWithValue.jsx

@howardchung
Copy link
Member

If we don't have a performance/load time issue then we don't necessarily have to do this. However, if we want to make the tooltips available in multiple languages, we will probably want to do this because loading multiple languages of abilities will get big really quickly.

@howardchung
Copy link
Member

howardchung commented Mar 1, 2017

Did a quick check, abilities data is currently about 720KB uncompressed and 120KB compressed. As of this writing the compressed bundle size is 923KB, so this is a pretty significant chunk of the bundle.

Items are 144KB. Assuming the same factor of 6 for compression that's 24KB compressed. All in all I estimate around 200KB of our bundle is dotaconstants data.

@howardchung howardchung changed the title Load ability, item tooltips from api instead of dotaconstants Load ability, item, hero data from api instead of dotaconstants Apr 7, 2017
@howardchung
Copy link
Member

Doing this will also enable translated data, since the client can just request data in the desired language.

@howardchung howardchung changed the title Load ability, item, hero data from api instead of dotaconstants dynamically import ability, item, hero data Apr 15, 2018
@howardchung
Copy link
Member

status update: done for abilities, not done for heroes/items at this point

@howardchung
Copy link
Member

I also recently did this for items. Heroes is left (but is also the smallest of the three), plus being heavily used means we may not benefit as much from the code splitting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants