MasterKale / SimpleWebAuthn

WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
https://simplewebauthn.dev
MIT License
1.63k stars 138 forks source link

fix/issue-114-es5-better-build-version-and-as-default #119

Closed akanass closed 3 years ago

akanass commented 3 years ago

This PR updates @simplewebauthn/browser's build and bundling pipeline to generate artifacts to support a wider range of use cases. This includes:

A new "main" build that targets ES5 A new "main:es2018" build that targets ES2018 A UMD bundle that targets ES2018 A UMD bundle that targets ES5 for deprecated browsers

ES5 version has been optimised to have a better weight at the end and compatible with browser and node build systems.

The documentation has been updated as well to explain ES5 is now the default version and how to use ES2018 in build systems.

This should address Issue #114 and especially for framework with SSR compatibility.

You can see the result of the new build with Next.js here

akanass commented 3 years ago

@MasterKale this PR makes a better ES5 version so we have to use it anyway.

If you want to have ES5 as default you can use all of this else I have just to rollback package.json and README and ES2018 will still be the default version but the new ES5 has to be used because it's an optimised one.

akanass commented 3 years ago

As discussed with @Moumouls in #114 we agreed that ES5 has to be the default one to support build and rendering in client and server side without any trick like this more people will be able to use it in old and modern browsers.

akanass commented 3 years ago

@MasterKale the requested changes have been made. You'll have to decide how to bump the version because we don't have the same default version anymore so I think 2.3.0 would be the minimum

MasterKale commented 3 years ago

I just tested this out in Next.JS and Create-React-App in IE10 and IE11 and everything seems fine. Thank you for another speedy build improvement! 😃

akanass commented 3 years ago

@MasterKale It was my pleasure again to help on it and glad you're happy with this 😄