Skip to content
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

chore(expo-passkeys): Use Expo bundled version #5402

Merged
merged 6 commits into from
Mar 27, 2025

Conversation

wobsoriano
Copy link
Member

@wobsoriano wobsoriano commented Mar 20, 2025

Description

Removed expo-modules-core from dependencies in favor of expo as a peer dependency to allow broader compatibility with Expo SDK versions ^50 || ^51 || ^52.

The Expo module template also imports functions directly from the expo module instead of the expo-modules-core package, which is meant to be used internally.

Checklist

  • pnpm test runs as expected.
  • pnpm 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:

Copy link

changeset-bot bot commented Mar 20, 2025

🦋 Changeset detected

Latest commit: b98ee95

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

This PR includes changesets to release 2 packages
Name Type
@clerk/expo-passkeys Minor
@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

Copy link

vercel bot commented Mar 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
clerk-js-sandbox ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 27, 2025 2:58am

@wobsoriano wobsoriano changed the title chore(expo-passkeys: Bump expo-modules-core to support Expo SDK 52 chore(expo-passkeys): Bump expo-modules-core to support Expo SDK 52 Mar 20, 2025
@clerk clerk deleted a comment from clerk-cookie Mar 20, 2025
@wobsoriano wobsoriano changed the title chore(expo-passkeys): Bump expo-modules-core to support Expo SDK 52 chore(expo-passkeys): Remove expo-modules-core from dependencies in favor of Expo's bundled version Mar 20, 2025
@wobsoriano
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @wobsoriano - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.0.12-snapshot.v20250320015558
@clerk/astro 2.4.1-snapshot.v20250320015558
@clerk/backend 1.25.4-snapshot.v20250320015558
@clerk/clerk-expo 2.9.1-snapshot.v20250320015558
@clerk/expo-passkeys 0.2.0-snapshot.v20250320015558
@clerk/express 1.3.55-snapshot.v20250320015558
@clerk/fastify 2.1.28-snapshot.v20250320015558
@clerk/nextjs 6.12.7-snapshot.v20250320015558
@clerk/nuxt 1.4.2-snapshot.v20250320015558
@clerk/react-router 1.1.7-snapshot.v20250320015558
@clerk/remix 4.5.7-snapshot.v20250320015558
@clerk/testing 1.4.29-snapshot.v20250320015558

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.0.12-snapshot.v20250320015558 --save-exact

@clerk/astro

npm i @clerk/astro@2.4.1-snapshot.v20250320015558 --save-exact

@clerk/backend

npm i @clerk/backend@1.25.4-snapshot.v20250320015558 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.9.1-snapshot.v20250320015558 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@0.2.0-snapshot.v20250320015558 --save-exact

@clerk/express

npm i @clerk/express@1.3.55-snapshot.v20250320015558 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.28-snapshot.v20250320015558 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.12.7-snapshot.v20250320015558 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.4.2-snapshot.v20250320015558 --save-exact

@clerk/react-router

npm i @clerk/react-router@1.1.7-snapshot.v20250320015558 --save-exact

@clerk/remix

npm i @clerk/remix@4.5.7-snapshot.v20250320015558 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.29-snapshot.v20250320015558 --save-exact

@@ -1,4 +1,4 @@
import { requireNativeModule } from 'expo-modules-core';
import { requireNativeModule } from 'expo';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would make the package compatible only with SDK 52, and we don't want that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm working under the assumption that this change actually makes it work with work with any Expo SDK version since our expo peerDeps is agnostic (*) and we only reference SDK 52 in devDeps.

Also, this approach mimics the structure of a freshly scaffolded Expo module via npx create-expo-module

Screenshot 2025-03-20 at 12 07 21 AM

What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think import { requireNativeModule } from 'expo'; is only available in SDK 52, at lease that's my understanding from their docs.

52

image

51

image

Copy link
Member Author

@wobsoriano wobsoriano Mar 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, interesting. Thanks!

I checked Expo SDK versions 49-52 on NPM and they all export requireNativeModule. Do we want to support SDKs lower than that?

I'll investigate more, thanks!

Screenshot 2025-03-20 at 7 16 53 AM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just got a great response from the Expo team on Discord! They confirmed we should import from "expo" instead of "expo-modules-core" since:

  1. expo-modules-core is meant to be internal to Expo's infrastructure
  2. expo package controls the correct version of expo-modules-core
  3. We should set it up with:
    • peerDependencies: expo: "^50 || ^51 || ^52" (for version ranges we want to support)
    • devDependencies: expo: "" (for testing)

We're on the right track! 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, why there is still documentation that uses expo-modules-core directly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Expo team confirmed it's an outdated doc 👍🏼

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@panteliselef Opened the PR - our youtube partner followed up with the snapshot version they tried and said it worked for them 🙏🏼

"@clerk/types": "workspace:^"
},
"devDependencies": {
"expo": "~52.0.0"
},
"peerDependencies": {
"expo": "*",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Open for discussion regarding min version. requireNativeModule was only available since Expo SDK 49.

I think SDK 50 is good ^50 || ^51 || ^52

@wobsoriano wobsoriano changed the title chore(expo-passkeys): Remove expo-modules-core from dependencies in favor of Expo's bundled version chore(expo-passkeys): Use Expo's bundled version Mar 25, 2025
@wobsoriano wobsoriano force-pushed the rob/expo-module-scripts-upgrade branch from c441704 to 78998bb Compare March 26, 2025 21:16
@wobsoriano wobsoriano marked this pull request as ready for review March 26, 2025 21:41
@wobsoriano
Copy link
Member Author

!snapshot

@clerk-cookie
Copy link
Collaborator

Hey @wobsoriano - the snapshot version command generated the following package versions:

Package Version
@clerk/agent-toolkit 0.0.16-snapshot.v20250327005036
@clerk/astro 2.4.5-snapshot.v20250327005036
@clerk/backend 1.25.8-snapshot.v20250327005036
@clerk/chrome-extension 2.2.23-snapshot.v20250327005036
@clerk/clerk-js 5.58.1-snapshot.v20250327005036
@clerk/elements 0.23.8-snapshot.v20250327005036
@clerk/clerk-expo 2.9.6-snapshot.v20250327005036
@clerk/expo-passkeys 0.2.0-snapshot.v20250327005036
@clerk/express 1.3.59-snapshot.v20250327005036
@clerk/fastify 2.1.32-snapshot.v20250327005036
@clerk/localizations 3.13.4-snapshot.v20250327005036
@clerk/nextjs 6.12.12-snapshot.v20250327005036
@clerk/nuxt 1.4.6-snapshot.v20250327005036
@clerk/clerk-react 5.25.5-snapshot.v20250327005036
@clerk/react-router 1.1.11-snapshot.v20250327005036
@clerk/remix 4.5.11-snapshot.v20250327005036
@clerk/shared 3.2.3-snapshot.v20250327005036
@clerk/tanstack-react-start 0.12.2-snapshot.v20250327005036
@clerk/testing 1.4.33-snapshot.v20250327005036
@clerk/themes 2.2.26-snapshot.v20250327005036
@clerk/types 4.50.1-snapshot.v20250327005036
@clerk/vue 1.4.5-snapshot.v20250327005036

Tip: Use the snippet copy button below to quickly install the required packages.
@clerk/agent-toolkit

npm i @clerk/agent-toolkit@0.0.16-snapshot.v20250327005036 --save-exact

@clerk/astro

npm i @clerk/astro@2.4.5-snapshot.v20250327005036 --save-exact

@clerk/backend

npm i @clerk/backend@1.25.8-snapshot.v20250327005036 --save-exact

@clerk/chrome-extension

npm i @clerk/chrome-extension@2.2.23-snapshot.v20250327005036 --save-exact

@clerk/clerk-js

npm i @clerk/clerk-js@5.58.1-snapshot.v20250327005036 --save-exact

@clerk/elements

npm i @clerk/elements@0.23.8-snapshot.v20250327005036 --save-exact

@clerk/clerk-expo

npm i @clerk/clerk-expo@2.9.6-snapshot.v20250327005036 --save-exact

@clerk/expo-passkeys

npm i @clerk/expo-passkeys@0.2.0-snapshot.v20250327005036 --save-exact

@clerk/express

npm i @clerk/express@1.3.59-snapshot.v20250327005036 --save-exact

@clerk/fastify

npm i @clerk/fastify@2.1.32-snapshot.v20250327005036 --save-exact

@clerk/localizations

npm i @clerk/localizations@3.13.4-snapshot.v20250327005036 --save-exact

@clerk/nextjs

npm i @clerk/nextjs@6.12.12-snapshot.v20250327005036 --save-exact

@clerk/nuxt

npm i @clerk/nuxt@1.4.6-snapshot.v20250327005036 --save-exact

@clerk/clerk-react

npm i @clerk/clerk-react@5.25.5-snapshot.v20250327005036 --save-exact

@clerk/react-router

npm i @clerk/react-router@1.1.11-snapshot.v20250327005036 --save-exact

@clerk/remix

npm i @clerk/remix@4.5.11-snapshot.v20250327005036 --save-exact

@clerk/shared

npm i @clerk/shared@3.2.3-snapshot.v20250327005036 --save-exact

@clerk/tanstack-react-start

npm i @clerk/tanstack-react-start@0.12.2-snapshot.v20250327005036 --save-exact

@clerk/testing

npm i @clerk/testing@1.4.33-snapshot.v20250327005036 --save-exact

@clerk/themes

npm i @clerk/themes@2.2.26-snapshot.v20250327005036 --save-exact

@clerk/types

npm i @clerk/types@4.50.1-snapshot.v20250327005036 --save-exact

@clerk/vue

npm i @clerk/vue@1.4.5-snapshot.v20250327005036 --save-exact

Copy link
Member

@jacekradko jacekradko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds like this is the proper way to go 👍🏼

@jacekradko jacekradko changed the title chore(expo-passkeys): Use Expo's bundled version chore(expo-passkeys): Use Expo bundled version Mar 27, 2025
@wobsoriano
Copy link
Member Author

Sounds like this is the proper way to go 👍🏼

Thanks Jacek! Doing some sanity checks locally now making sure it works as we don't have a proper test yet

@wobsoriano wobsoriano enabled auto-merge (squash) March 27, 2025 03:06
@wobsoriano wobsoriano merged commit 3c47ce8 into main Mar 27, 2025
30 checks passed
@wobsoriano wobsoriano deleted the rob/expo-module-scripts-upgrade branch March 27, 2025 03:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants