-
-
Notifications
You must be signed in to change notification settings - Fork 83
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
Option to allow overriding existing import map entries in shim mode #254
Comments
Hi @lewisl9029, agreed this could be a useful option to add. If you're able to work on a PR that would be great. Please just try to keep the byte size of the implementation as small as possible! |
@guybedford random idea related to your comment on byte size: wdty of potentially having a separate build for shim vs polyfill mode to further optimize byte size? It seems unlikely for a site to need to switch between two modes, and even more unlikely that it would ever work. Might be as straightforward as replacing the shimMode export to a build-time injected boolean and reconfiguring the bundler. Will be a breaking change for users depending on automatic shim-mode detection, but I think it might be worthwhile longer term. Happy to explore this as a separate follow up PR if that sounds like something worth exploring! |
@lewisl9029 if there could be a significant file saving that could be interesting, although I'm not sure it would be such a big saving as most of the code paths are shared. Separating features might well be a byte size reduction approach in future though eg having extensions loaded in based on what is needed. At the same time I quite like that it's one thing at the moment, does simplify the integration process too. |
Sounds good, I think I'll give it a shot in a quick and dirty way to explore how much we could potentially save, then we could decide if it's worthwhile once we have some actual numbers. |
Landed in #257. |
Hi again! 🙂
In an earlier PR we added this check to throw when users attempt to override an existing import map entry.
Fast forward to today, and I actually found a nasty edge case in my custom react-refresh workflow that requires overriding existing import map entries to fix. 😅
Would you be open to adding an option to bypass the check? Maybe in the form of an
allowOverrides
init option that defaults to false and only takes effect in shim mode?Happy to send over a PR if you're ok with the idea. Thanks!
The text was updated successfully, but these errors were encountered: