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

Make Dreact serve different JS bundles depend on what's the browser request them #26

Open
5 tasks
radion-chernyakov opened this issue Feb 14, 2020 · 2 comments
Labels

Comments

@radion-chernyakov
Copy link

Why is it matters:

  • allows you to ship only polyfills that browser really need
  • makes modern browsers be able to use native syntax instead of transpired into old one (as class or ?. operator)

All these things reduce JS bundle size which improves client performance metrics

Todo:

  • ? migrate to next.js first
  • make different browserslist ENVs based on users statistic
  • make separate JS bundles for each ENV
  • serve different JS bundles based on useragent on same request path (doesn't work with CDN)
    OR
  • serve different HTML with different paths to JS bundle based on useragent

App faster -> users happier -> client happier :)

@ezhlobo
Copy link
Member

ezhlobo commented Feb 15, 2020

@nixololo I love this and thank you very much for converting this into a well-described issue.

I agree with your todo list, our choice between react-scripts and nextjs will influence on how we'll implement it.

@radion-chernyakov
Copy link
Author

@ezhlobo

our choice between react-scripts and nextjs

As I already mentioned in slack seems like making this with next.js is a tricky thing to do. The most blocking thing is that they don't use browserslist:

I'll try this idea with react-scripts and will leave report here

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

No branches or pull requests

2 participants