.browserslistrc support #4769
Replies: 6 comments 3 replies
-
I agree that the default should be any ESM-capable browser, another option is to support last 2 version of every browser, and document this somewhere, so you know that by default Remix browser build is a modern one but you can still support old ESM-capable browsers by using a custom browserlist configuration.
That could be an option if the file is not present but still has a default, so again default to all ESM-capable browsers or last 2 versions or something like that but only if there's no browserlist configuration, and if there's any respect that one. |
Beta Was this translation helpful? Give feedback.
-
How large are we talking? Would be interesting to see some metrics about what that means for the react build, and an approximation for a route |
Beta Was this translation helpful? Give feedback.
-
Any news? It's big issue for us :( |
Beta Was this translation helpful? Give feedback.
-
I think this comment from #4704 highlights a point I wanted to raise. Even though the compilation fails
This is why I think it's important to distinguish between "users can bring their own Remix can't/shouldn't be expected to have code that compiles to any target (IE6, etc) but specifying some collection like "supports es6-module" or "defaults and supports es6-module, maintained node versions" that are supported would be an important and helpful distinction. The |
Beta Was this translation helpful? Give feedback.
-
#6114 I think exposing the browser list will help me. |
Beta Was this translation helpful? Give feedback.
-
This is very helpful for Chinese developers, where users are always reluctant to upgrade their browser |
Beta Was this translation helpful? Give feedback.
-
Remix (with JS enabled) requires a browser that supports ESM via it's usage of
<script type="module">
and will fall back to non-JS functionality for those that don't. However, there is still the ability for us to ship broken code to browsers that support ESM by using language features not yet supported by those browsers.As an example:
??
) support didn't come until Chrome 80 + Safari 13.1??
not being supported)We've broken apps a few times this far and manually removed the
??
from our@remix-run/react
code (#270, #3880, #4561), but it's currently something we have to manually remember not to use. With.browserlistrc
support we'd able to code Remix using modern language features knowing that our build will transpile down according to the user's needs.Related Issues/Discussions:
Proposed Approach
esbuild
config.browserlistrc
viacreate-remix
that aligns with ESM browser supportbrowserlistrc
to fix themCaveats
We should make it clear in our docs that
esbuild
doesn't polyfill, it only handles transforming unsupported language syntaxes, so folks would still need to be responsible for polyfilling stuff (i.e.,Array.prototype.flatMap
) if their browsers didn't support it.We could point them to https://polyfill.io/v3/ presumably.
Beta Was this translation helpful? Give feedback.
All reactions