-
Notifications
You must be signed in to change notification settings - Fork 111
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
IE11 not working with latest release #172
Comments
@bparish628 👋 Thanks for reaching out! We definitely transpile the code (and those settings, without any browser targets, should be putting everything back down the ES5) -- at least, it's supposed to be getting transpiled! However, looking at I'll try to fix this ASAP! |
Problem seems to be that |
Unfortunately, I've been trying to get rollup (not a fan!!) to use Babel for the past hour and a half, trying everything I can think of, nothing is working. |
Of course, no one on the Internet seems to have this issue. The plugin just works... |
@stefcameron |
@bparish628 Thanks for the suggestion. Could be plugin order. I tried running the babel plugin as the first one in the plugin list, didn't change a thing. I can try running it after terser() to see. One thing I do see -- and maybe this supports your theory -- is that the minified files seem to be transpiled. Can you give focus-trap.min.js a try to see if you have a problem in IE11? I think it'll work. |
Unfortunately, changing the order of plugins to execute babel() after terser() doesn't change anything for the non-minified bundles. |
I was looking at the rollup config, and I don't think it's running the non-minified through babel. https://github.com/focus-trap/focus-trap/blob/master/rollup.config.js#L92 Wouldn't you would want to add |
@bparish628 Oh no, don't tell me... 🤦 Yep, that's it. Thank you for being my second set of 👀 . Just couldn't see it! I think there's another issue with babel in that the ESM bundle should be created with ESM browsers as a target, not ES5 browsers, so I'll take the opportunity to make sure that happens correctly as well while I'm in there. |
Fixes issue #172 Also targets browsers that support ESM when transpiling for the ESM build, rather than targetting browsers with ES5 support.
Fixes issue #172 Also targets browsers that support ESM when transpiling for the ESM build, rather than targetting browsers with ES5 support.
@bparish628 Should be fixed in #173. Can you have a look, see if it looks good to you? |
Thanks for checking that. |
Fixes issue #172 Also targets browsers that support ESM when transpiling for the ESM build, rather than targetting browsers with ES5 support. * Babel preset should use 'modules: false' for ESM * `tabbable` should be external in all builds
@all-contributors add @bparish628 for bug |
I've put up a pull request to add @bparish628! 🎉 |
That version of tabbable has transpiled non-minified bundles, which will help with #172.
That version of tabbable has transpiled non-minified bundles, which will help with #172.
Published in |
Tabbable was fixed in 5.1.1 |
@stefcameron Sorry for commenting on a closed ticket, but I was testing the latest version and it looks like tabbable still doesn't work as expected 🤔 (it's using 5.1.1). I was looking at the dist and the
while the index.js has
This library is working awesome though! No errors from here, just from tabbable |
No worries! @bparish628, @khamiltonuk has the same inquiry over on #173 just now, my response there. Let's continue the discussion there to keep it one place. |
I'm re-opening this on account of focus-trap/tabbable#99 and to track that we need to add the |
Fixes #172 again. AFAICT, this seems to be the best solution to what __a lot__ of folks in the community have been experiencing with ESM bundles, referenced from a package's `module` entry, that aren't also transpiled down to ES5 (which is technically in conflict with ESM, which is an ES6 feature). The problem arises because this package states both `module` and `main`, but Webpack defaults `mainFields` to `['browser', 'module', 'main']`, in order. So it will always pick `module` over `main` by default, because it doesn't understand that the build's target is NOT a browser that supports ESM... See webpack/webpack#5756
Fixes #172 again. See webpack/webpack#5756 The initial approach was to add a `browser` target to package.json and point it at the UMD build so that bundlers would pick that up instead of the ESM build, since they (except for Rollup) tend to prefer `browser` first, then `module` (ESM), then `main`. But that would potentially affect tree-shaking, and we don't want to hamper that optimizing process. So this PR transpiles the code in the ESM bundle down to ES5, so that it runs in IE9+ like the CJS and UMD bundles do, while keeping the import/export ESM statements.
To help close the gap with #172, bump the version since it has a similar fix to tabbable.
To help close the gap with #172, bump the version since it has a similar fix to tabbable.
I have published |
@stefcameron Awesome work! I have pulled down the latest and everything appears to be working as I would expect 💯. Thanks for the quick turnaround on this issue. 😄 |
Wonderful, glad to hear it's working. My pleasure! |
The issue here is that a new feature was added in v6 that does not include ie11 supported code. The culprit is the because the userOptions is being spread onto an object.
https://github.com/focus-trap/focus-trap/blob/master/index.js#L48
Introduced in #125
Does this code get transpiled or should the src be compliant? I'd be happy to make a fix to it, just want to verify what the intention is!
Error is
Expected identifier, string or number
@ this line
Steps to Recreate
The text was updated successfully, but these errors were encountered: