javascript icon indicating copy to clipboard operation
javascript copied to clipboard

fix(clerk-js): Bundle the `zxcvbn` library inside the headless variant

Open anagstef opened this issue 1 year ago • 5 comments

Description

Currently, the zxcvbn is lazy loaded on clerk-js due to its size. However, using import() is not working in non-browser environments, including Expo.

Considering the assumption that the clerk.headless.js variant is only used on native environments, this PR bundles the whole zxcvbn inside the headless clerk-js.

This PR will fix the usage of the validatePassword on Expo.

Checklist

  • [ ] npm test runs as expected.
  • [ ] npm run build runs as expected.
  • [ ] (If applicable) JSDoc comments have been added or updated for any package exports
  • [ ] (If applicable) Documentation has been updated

Type of change

  • [ ] 🐛 Bug fix
  • [ ] 🌟 New feature
  • [ ] 🔨 Breaking change
  • [ ] 📖 Refactoring / dependency upgrade / documentation
  • [ ] other:

anagstef avatar Mar 22 '24 16:03 anagstef

🦋 Changeset detected

Latest commit: b3e55f890211388d34017f8f25499906829d80f4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@clerk/clerk-js Patch
@clerk/chrome-extension Patch
@clerk/clerk-expo Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

changeset-bot[bot] avatar Mar 22 '24 16:03 changeset-bot[bot]

@anagstef Let's add an e2e here that uses the headless entry and calls validatePassword() 👀

brkalow avatar Mar 22 '24 22:03 brkalow

@anagstef I think we should also mention the increase in the bundle size as it is significant.

panteliselef avatar Mar 26 '24 07:03 panteliselef

@anagstef Let's add an e2e here that uses the headless entry and calls validatePassword() 👀

@BRKalow we should find a way to mimic the non-browser environment. We should give a shot to https://wix.github.io/Detox/

@anagstef I think we should also mention the increase in the bundle size as it is significant.

@panteliselef you mean on the changeset?

anagstef avatar Mar 26 '24 10:03 anagstef

@anagstef do we have any updates on this one?

nikosdouvlis avatar Apr 10 '24 08:04 nikosdouvlis

This looks like a stale PR. Closing for now, lets reopen if we need to.

nikosdouvlis avatar Jun 05 '24 10:06 nikosdouvlis