Skip to content

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

Closed

Description

@yousefelgoharyx

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

Activity

  1. mrmckeb commented on Jun 23, 2019

    @mrmckeb
    Contributor

    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.

  2. self-assigned this
    on Jun 23, 2019
  3. Pajn commented on Jun 25, 2019

    @Pajn
    Contributor

    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.

  4. iansu commented on Jun 25, 2019

    @iansu
    Contributor

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

    I'm going to close this as a duplicate.

  5. locked and limited conversation to collaborators on Jun 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions