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

Suggestion: add 2 bundles for legacy and modern browsers #7263

Closed
yousefelgoharyx opened this issue Jun 22, 2019 · 3 comments
Closed

Suggestion: add 2 bundles for legacy and modern browsers #7263

yousefelgoharyx opened this issue Jun 22, 2019 · 3 comments
Assignees

Comments

@yousefelgoharyx
Copy link

It'd be awesome if you make an option while building react app an option that makes a script determines whether this is a legacy browser or modern one so the script can deliver the right bundle to the client
It'd be much faster for modern browsers

@mrmckeb
Copy link
Contributor

mrmckeb commented Jun 23, 2019

Hi @yousefelgoharyx, of course this is possible - but generally it requires something server side.

If you'd like to take a look into a client-only solution or propose an approach, we'd definitely love to hear it. I agree that it would be great to ship the smallest bundle to every client.

@mrmckeb mrmckeb self-assigned this Jun 23, 2019
@Pajn
Copy link
Contributor

Pajn commented Jun 25, 2019

A server side solution is better in this case though.
A client side solution would be possible with a small inlined script in the index.html that injected the correct script tag. However that would not allow the browser to find the script tag with the preparser and start fetching it, before it can execute JavaScript. This makes the experience worse for everyone, though modern browsers would probably regain that loss with the more efficient bundle.

A serverside solution that falls back to serving the legacy (current) bundle if not configured would solve that problem and with good documentation examples it would be easy for people to opt in to the more optimised bundle.

@iansu
Copy link
Contributor

iansu commented Jun 25, 2019

This is something we've previously discussed and have done some work on: #4964

I'm going to close this as a duplicate.

@iansu iansu closed this as completed Jun 25, 2019
@lock lock bot locked and limited conversation to collaborators Jun 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants