-
-
Notifications
You must be signed in to change notification settings - Fork 136
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
feat/Clean build to have ES2018 as main version #129
Conversation
… update devDependencies
…ith the new entry declared in package.json
The only bundle I want to get rid of, based on the discussion in #128, is the ES5 CJS bundle. The ideal end state for @simplewebauthn/browser bundles breaks down thusly:
The ES5 build step still needs to happen, but with only the |
@MasterKale I will update my PR and get back the ES5 UMD bundle. But I don't understand why we still need the module entry? If we have the |
@MasterKale I've updated all |
Can we be sure |
@MasterKale I think only this PR is required and we can close #128 |
@MasterKale The Using The problem with This is the proof that |
@MasterKale @akanass My concern is that some bundlers won't recognise the "main" entry as an ES module, and that bundlers will assume that it's CJS format. In most packages, they have a "main" CJS entry, and a "module" ES module entry, so I think bundlers might make that distinction too… Anyways, it might be a good idea to just make sure that everything works with having an ES module as "main". |
@skoshx I don't agree with you because in You only use In our case I did it with my own library which was built like here before and I did the same updates then put it in a project and compile it in Build system will always look at the For me all is good like this. |
And as I always said, bundler are always taking the files in the order of So if you don't have |
Right… Anyways, good to see this PR merged! |
@skoshx Good looking out for this use case. I did some independent testing just now with the ES2018 ESM bundle as
I'm happy to report that all of these frameworks handled the ES2018 bundle as @akanass Thank you for your contribution to the cause. Here's to SimpleWebAuthn remaining simple to use going forward ✌️ |
@MasterKale Thank you for your trust and I am happy to have been able to improve our previous contribution and thank you also @skoshx for guiding us on it I'm just disappointed that we went in the wrong direction, thinking that we needed an ES5 version at all costs, I should have tested better with the @Moumouls repo The main thing is that we have something simple as the name carries it so well |
@MasterKale I saw your new release and maybe you should have made a major version because there is still a breaking change in the build system and the main version has been changed. Anyway for my library that's what I did, here it was just like that lol |
I did indeed just cut a new release, @simplewebauthn/browser@3.1.0 includes this PR.
I guess we'll see who this breaks 🙃 |
@MasterKale I meant having |
This PR updates @simplewebauthn/browser's build and bundling pipeline to generate artifacts to support a wider range of use cases in a simplified way to use. This includes:
A new "main" build that targets ES2018
A new "unpkg" entry in "package.json" to reference UMD bundle that targets ES2018
UMD bundle that targets ES2018
UMD bundle that targets ES5
The documentation has been updated as well to explain ES2018 is now the only version and how to use UMD bundle in a simplified way.