-
Notifications
You must be signed in to change notification settings - Fork 419
chore(remix): Remove M2M related feature #6749
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
Conversation
🦋 Changeset detectedLatest commit: 42e5641 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughRemoves machineSecretKey from the @clerk/remix public API and SSR flow. Updates authenticateRequest to omit the option, stops reading CLERK_MACHINE_SECRET_KEY in loadOptions, and removes the type from RootAuthLoaderOptions. Adds a changeset noting a minor bump and migration guidance to @clerk/react-router. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant U as User
participant R as Remix Loader/Action
participant A as authenticateRequest(...)
participant L as loadOptions(...)
participant C as Clerk Client
U->>R: HTTP request
R->>A: call authenticateRequest(args, opts)
rect rgba(230,240,255,0.5)
note right of A: Options no longer include machineSecretKey
A->>L: loadOptions(args, overrides)
L-->>A: options (without machineSecretKey)
end
A->>C: authenticateRequest({ ...options })
C-->>A: auth result
A-->>R: auth state
R-->>U: response
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks (1 passed, 1 warning, 1 inconclusive)❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
Please see the documentation for more information. Example: reviews:
pre_merge_checks:
custom_checks:
- name: "Undocumented Breaking Changes"
mode: "warning"
instructions: |
Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. ✨ Finishing Touches
🧪 Generate unit tests
Comment |
@clerk/agent-toolkit
@clerk/astro
@clerk/backend
@clerk/chrome-extension
@clerk/clerk-js
@clerk/dev-cli
@clerk/elements
@clerk/clerk-expo
@clerk/expo-passkeys
@clerk/express
@clerk/fastify
@clerk/localizations
@clerk/nextjs
@clerk/nuxt
@clerk/clerk-react
@clerk/react-router
@clerk/remix
@clerk/shared
@clerk/tanstack-react-start
@clerk/testing
@clerk/themes
@clerk/types
@clerk/upgrade
@clerk/vue
commit: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/remix/src/ssr/authenticateRequest.ts (1)
9-35: Remove legacymachineSecretKeyusage in Remix docs
- In packages/remix/CHANGELOG.md (line 143), update the example to remove
machineSecretKey: 'ak_xxxxx'so it matches the newauthenticateRequestAPI.
🧹 Nitpick comments (3)
packages/remix/src/ssr/authenticateRequest.ts (1)
11-12: Public API narrowed correctly; expose a named options type and add JSDoc for DX.Using
Omit<AuthenticateRequestOptions, 'machineSecretKey'>is fine, but it hurts discoverability in IDEs and makes changelogs less explicit. Consider exporting a named alias and documenting the removal in JSDoc.Apply this minimal change here:
-export async function authenticateRequest( - args: LoaderFunctionArgs, - opts: Omit<AuthenticateRequestOptions, 'machineSecretKey'>, -): Promise<SignedInState | SignedOutState> { +export async function authenticateRequest( + args: LoaderFunctionArgs, + opts: RemixAuthenticateRequestOptions, +): Promise<SignedInState | SignedOutState> {And in
packages/remix/src/ssr/types.ts(or a shared localtypes.ts), add:import type { AuthenticateRequestOptions } from '@clerk/backend/internal'; /** * Remix-specific authenticateRequest options. * Note: `machineSecretKey` was removed from the Remix integration. */ export type RemixAuthenticateRequestOptions = Omit<AuthenticateRequestOptions, 'machineSecretKey'>;Optional (dev-only guard to aid migration for JS consumers):
if (process.env.NODE_ENV !== 'production' && (opts as any) && 'machineSecretKey' in (opts as any)) { // eslint-disable-next-line no-console console.warn('[@clerk/remix] `machineSecretKey` is no longer supported in Remix. Migrate to @clerk/react-router.'); }Also add a short JSDoc block above this function noting the removal and pointing to the migration path.
.changeset/poor-cycles-dress.md (2)
5-5: Clarify what changed and the impact (mention env var too).Explicitly note that
CLERK_MACHINE_SECRET_KEYis no longer read by the Remix integration to prevent confusion.-Remove `machineSecretKey` option. Please migrate to `@clerk/react-router` instead. +Remove the `machineSecretKey` option from the Remix integration. The `CLERK_MACHINE_SECRET_KEY` env var is no longer read by `@clerk/remix`. + +If you need machine-to-machine (M2M) flows, please migrate to `@clerk/react-router`.
7-8: Fix markdownlint MD034 (bare URLs) and improve link text.-Migration guide: https://reactrouter.com/upgrading/remix -React Router SDK: https://clerk.com/docs/quickstarts/react-router +Migration guide: [Remix → React Router upgrade](https://reactrouter.com/upgrading/remix) +React Router SDK: [Clerk + React Router quickstart](https://clerk.com/docs/quickstarts/react-router)
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (4)
.changeset/poor-cycles-dress.md(1 hunks)packages/remix/src/ssr/authenticateRequest.ts(1 hunks)packages/remix/src/ssr/loadOptions.ts(0 hunks)packages/remix/src/ssr/types.ts(0 hunks)
💤 Files with no reviewable changes (2)
- packages/remix/src/ssr/types.ts
- packages/remix/src/ssr/loadOptions.ts
🧰 Additional context used
📓 Path-based instructions (7)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
**/*.{js,jsx,ts,tsx}: All code must pass ESLint checks with the project's configuration
Follow established naming conventions (PascalCase for components, camelCase for variables)
Maintain comprehensive JSDoc comments for public APIs
Use dynamic imports for optional features
All public APIs must be documented with JSDoc
Provide meaningful error messages to developers
Include error recovery suggestions where applicable
Log errors appropriately for debugging
Lazy load components and features when possible
Implement proper caching strategies
Use efficient data structures and algorithms
Profile and optimize critical paths
Validate all inputs and sanitize outputs
Implement proper logging with different levels
Files:
packages/remix/src/ssr/authenticateRequest.ts
**/*.{js,jsx,ts,tsx,json,css,scss,md,yaml,yml}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use Prettier for consistent code formatting
Files:
packages/remix/src/ssr/authenticateRequest.ts
packages/**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
TypeScript is required for all packages
Files:
packages/remix/src/ssr/authenticateRequest.ts
packages/**/*.{ts,tsx,d.ts}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Packages should export TypeScript types alongside runtime code
Files:
packages/remix/src/ssr/authenticateRequest.ts
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/development.mdc)
Use proper TypeScript error types
**/*.{ts,tsx}: Always define explicit return types for functions, especially public APIs
Use proper type annotations for variables and parameters where inference isn't clear
Avoidanytype - preferunknownwhen type is uncertain, then narrow with type guards
Useinterfacefor object shapes that might be extended
Usetypefor unions, primitives, and computed types
Preferreadonlyproperties for immutable data structures
Useprivatefor internal implementation details
Useprotectedfor inheritance hierarchies
Usepublicexplicitly for clarity in public APIs
Preferreadonlyfor properties that shouldn't change after construction
Prefer composition and interfaces over deep inheritance chains
Use mixins for shared behavior across unrelated classes
Implement dependency injection for loose coupling
Let TypeScript infer when types are obvious
Useconst assertionsfor literal types:as const
Usesatisfiesoperator for type checking without widening
Use mapped types for transforming object types
Use conditional types for type-level logic
Leverage template literal types for string manipulation
Use ES6 imports/exports consistently
Use default exports sparingly, prefer named exports
Use type-only imports:import type { ... } from ...
Noanytypes without justification
Proper error handling with typed errors
Consistent use ofreadonlyfor immutable data
Proper generic constraints
No unused type parameters
Proper use of utility types instead of manual type construction
Type-only imports where possible
Proper tree-shaking friendly exports
No circular dependencies
Efficient type computations (avoid deep recursion)
Files:
packages/remix/src/ssr/authenticateRequest.ts
**/*.{js,ts,tsx,jsx}
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Support multiple Clerk environment variables (CLERK_, NEXT_PUBLIC_CLERK_, etc.) for configuration.
Files:
packages/remix/src/ssr/authenticateRequest.ts
.changeset/**
📄 CodeRabbit inference engine (.cursor/rules/monorepo.mdc)
Automated releases must use Changesets.
Files:
.changeset/poor-cycles-dress.md
🧬 Code graph analysis (1)
packages/remix/src/ssr/authenticateRequest.ts (1)
packages/backend/src/tokens/types.ts (1)
AuthenticateRequestOptions(19-75)
🪛 markdownlint-cli2 (0.17.2)
.changeset/poor-cycles-dress.md
7-7: Bare URL used
(MD034, no-bare-urls)
8-8: Bare URL used
(MD034, no-bare-urls)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
- GitHub Check: Integration Tests (nextjs, chrome, 15)
- GitHub Check: Integration Tests (nuxt, chrome)
- GitHub Check: Integration Tests (billing, chrome)
- GitHub Check: Integration Tests (react-router, chrome)
- GitHub Check: Integration Tests (custom, chrome)
- GitHub Check: Integration Tests (machine, chrome)
- GitHub Check: Integration Tests (tanstack-react-router, chrome)
- GitHub Check: Integration Tests (nextjs, chrome, 14)
- GitHub Check: Integration Tests (tanstack-react-start, chrome)
- GitHub Check: Integration Tests (quickstart, chrome)
- GitHub Check: Integration Tests (vue, chrome)
- GitHub Check: Integration Tests (expo-web, chrome)
- GitHub Check: Integration Tests (astro, chrome)
- GitHub Check: Integration Tests (localhost, chrome)
- GitHub Check: Integration Tests (generic, chrome)
- GitHub Check: Integration Tests (sessions, chrome)
- GitHub Check: Integration Tests (elements, chrome)
- GitHub Check: Integration Tests (express, chrome)
- GitHub Check: Integration Tests (ap-flows, chrome)
- GitHub Check: Static analysis
🔇 Additional comments (2)
packages/remix/src/ssr/authenticateRequest.ts (1)
16-16: LGTM: correct removal ofmachineSecretKeyfrom destructuring.No accidental propagation to the client call remains.
.changeset/poor-cycles-dress.md (1)
2-2: Semver level confirmed:machineSecretKeywas never part of any released@clerk/remix, so this change is non-breaking and a minor bump is appropriate.
Description
This PR is a follow up to #6744, removing the
machineSecretKeyproperty that was recently added.M2M is still in beta and Remix is in maintenance mode so this is good to remove 👍🏼
Checklist
pnpm testruns as expected.pnpm buildruns as expected.Type of change
Summary by CodeRabbit
Breaking Changes
Documentation
Chores