If we ignore tail call optimization (which is not supported even by recent versions of Chrome), the only browsers that support Promise but don't support some ES6 features are: I looked through kangax's compatibility tables and explored using native Promise support as a proxy for "good enough" ES6 support. Providing a way for module authors to specify whether or not their code should be run in a legacy context could help streamline things.ĮS6 compatibility isn't easy to test for, because there are so many aspects of ES6. There will likely be a lengthy transitional period where a few features are written this way but most are still backwards-compatible with ES5. If a team is developing a new feature which already provides a no-JS fallback, they may decide that the JS-enhanced version doesn't need to jump through the extra hoops to support IE11. So maybe it's less about which minifier to use and more about giving developers the ability to decide whether or not to support legacy browsers on a per-module basis. In browsers that support ES5 but not ES6 (like IE11), we'd presumably want to execute the ES5-compatible modules, but not the ES6 ones. ResourceLoader currently does not have a concept of per-module executability, only a global one: the startup code feature-detects ES5 support, and either decides that no JavaScript is going to be executed or that everything can be. Modules that are flagged as using ES6 should not be executed in browsers that don't support ES6 (most prominently including IE11). If Terser is still needed for any reason this can be configured.Alongside this, I think we should also formalize the notion of grade B (in between grade A and grade C) in ResourceLoader. Next.js' swc compiler is used for minification by default since v13. We're working to port babel-plugin-styled-components to the Next.js Compiler.įirst, update to the latest version of Next.js: npm install Then, update your file:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |