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): Remove expo-modules-core from dependencies in favor of Expo's bundled version #5402

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

wobsoriano
Copy link
Member

Description

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: c441704

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 20, 2025 1:53am

@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/[email protected] --save-exact

@clerk/astro

npm i @clerk/[email protected] --save-exact

@clerk/backend

npm i @clerk/[email protected] --save-exact

@clerk/clerk-expo

npm i @clerk/[email protected] --save-exact

@clerk/expo-passkeys

npm i @clerk/[email protected] --save-exact

@clerk/express

npm i @clerk/[email protected] --save-exact

@clerk/fastify

npm i @clerk/[email protected] --save-exact

@clerk/nextjs

npm i @clerk/[email protected] --save-exact

@clerk/nuxt

npm i @clerk/[email protected] --save-exact

@clerk/react-router

npm i @clerk/[email protected] --save-exact

@clerk/remix

npm i @clerk/[email protected] --save-exact

@clerk/testing

npm i @clerk/[email protected] --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 👍🏼

"@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

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.

3 participants