diff --git a/.changeset/pre.json b/.changeset/pre.json index 3af8b980da0..bca90d21c9b 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -19,6 +19,8 @@ "@clerk/types": "3.57.0" }, "changesets": [ + "afraid-nails-play", + "angry-clocks-attend", "blue-garlics-remain", "blue-ghosts-float", "blue-grapes-marry", @@ -27,7 +29,10 @@ "bright-knives-jump", "bright-plants-swim", "bright-trainers-sort", + "bright-ways-provide", "brown-clouds-divide", + "brown-ducks-reply", + "chatty-beans-fix", "chatty-berries-jump", "chatty-boats-tease", "chilly-donuts-work", @@ -45,7 +50,9 @@ "curvy-mails-rhyme", "curvy-timers-play", "cyan-dodos-provide", + "cyan-rockets-fail", "cyan-stingrays-own", + "dirty-icons-rescue", "dirty-panthers-begin", "dry-feet-join", "dry-sheep-poke", @@ -55,11 +62,13 @@ "early-forks-argue", "early-timers-wave", "early-tomatoes-hide", + "eight-badgers-speak", "eleven-bananas-joke", "empty-jars-press", "fair-cameras-boil", "famous-carrots-notice", "famous-forks-buy", + "famous-spies-clean", "fast-ads-mix", "fast-games-hide", "fast-swans-smile", @@ -71,11 +80,14 @@ "flat-pots-hear", "fluffy-chicken-explain", "friendly-months-film", + "friendly-parrots-nail", "friendly-tables-chew", "friendly-vans-develop", "funny-gifts-cough", "funny-lamps-work", "fuzzy-horses-fix", + "fuzzy-years-taste", + "gentle-donkeys-talk", "gentle-pants-matter", "gold-fireants-sort", "gold-islands-cover", @@ -84,10 +96,12 @@ "grumpy-suns-boil", "heavy-falcons-help", "heavy-horses-nail", + "hip-eagles-clap", "honest-onions-work", "hungry-bears-allow", "hungry-bikes-clean", "hungry-news-bathe", + "itchy-chairs-argue", "khaki-buttons-march", "khaki-spoons-teach", "khaki-timers-work", @@ -102,9 +116,11 @@ "little-dolphins-scream", "little-numbers-jam", "long-beds-mate", + "long-dancers-whisper", "long-icons-share", "loud-countries-hang", "loud-lions-compete", + "lovely-jobs-arrive", "lovely-mirrors-remember", "lovely-plums-sin", "lovely-spies-kiss", @@ -115,7 +131,9 @@ "mean-poets-bow", "metal-baboons-vanish", "metal-cougars-fail", + "metal-ears-cheat", "metal-olives-press", + "mighty-bulldogs-try", "mighty-melons-greet", "mighty-pugs-knock", "moody-radios-begin", @@ -123,30 +141,38 @@ "moody-zoos-deliver", "nasty-books-tap", "neat-lies-thank", + "neat-numbers-decide", "new-cougars-taste", "new-eels-mix", "new-points-train", "new-points-turn", "nice-dingos-argue", + "nice-doors-fail", "nice-starfishes-itch", + "nine-beans-travel", "odd-lemons-reply", "odd-toes-develop", "old-actors-beg", "old-ads-push", + "old-timers-obey", + "olive-steaks-end", "orange-pumpkins-poke", "pink-days-drum", "polite-kiwis-arrive", "poor-horses-press", "poor-kings-marry", + "popular-parents-hope", "popular-singers-sort", "pretty-mice-share", "pretty-months-greet", + "pretty-scissors-thank", "pretty-singers-change", "proud-hairs-check", "purple-pumas-study", "purple-rules-prove", "quick-countries-scream", "quick-trains-rush", + "quiet-cougars-watch", "rare-bottles-sell", "rare-students-sell", "real-cougars-design", @@ -156,57 +182,80 @@ "red-shrimps-hunt", "red-worms-fetch", "rich-actors-cross", + "rich-readers-obey", "rotten-ways-do", "rude-jobs-yawn", "rude-lamps-yawn", "selfish-eggs-sort", "selfish-trains-breathe", "shaggy-points-cheer", + "shaggy-pumpkins-tap", "sharp-trains-ring", + "shiny-glasses-switch", + "shiny-pumas-share", + "short-eagles-search", + "short-kings-mate", + "shy-bikes-draw", + "silent-comics-roll", "silly-emus-boil", "silly-icons-kick", "silly-poems-tease", "silver-cats-appear", "six-kangaroos-serve", + "sixty-frogs-pump", "slimy-brooms-smoke", "slimy-singers-glow", "slimy-windows-grab", "slimy-wolves-burn", + "slow-bugs-exist", "slow-eels-fly", "slow-wombats-battle", + "small-cats-check", "smart-suns-train", "smooth-baboons-shake", + "smooth-pets-rhyme", "soft-birds-thank", + "soft-fireants-jog", "soft-swans-swim", + "sour-avocados-sin", "sour-comics-stare", + "spicy-feet-buy", "spotty-apples-march", "spotty-boxes-do", "spotty-roses-push", "strong-cows-sit", "stupid-suits-accept", "stupid-toys-remain", + "sweet-pumas-press", "swift-rocks-nail", "tall-roses-invent", + "tame-olives-check", "tasty-countries-walk", "tasty-phones-lie", "ten-mugs-film", "ten-nails-whisper", "thin-phones-drop", + "thirty-chicken-divide", "thirty-doors-peel", "thirty-insects-exist", "tiny-forks-sit", "tough-pots-grow", "tough-roses-hunt", + "tricky-swans-develop", "twenty-elephants-try", "two-pumas-doubt", "two-terms-speak", + "violet-birds-scream", "weak-elephants-grin", "wicked-spoons-confess", "wild-phones-smoke", "wise-houses-shop", "wise-lions-type", + "witty-forks-cheer", "yellow-elephants-begin", + "yellow-tigers-know", "young-experts-attack", - "young-frogs-enjoy" + "young-frogs-enjoy", + "young-items-explode" ] } diff --git a/packages/backend/CHANGELOG.md b/packages/backend/CHANGELOG.md index 64d2cbe0f4d..045a020f0ac 100644 --- a/packages/backend/CHANGELOG.md +++ b/packages/backend/CHANGELOG.md @@ -1,5 +1,53 @@ # Change Log +## 1.0.0-alpha-v5.8 + +### Major Changes + +- Remove the named `Clerk` import from `@clerk/backend` and import `createClerkClient` instead. The latter is a factory method that will create a Clerk client instance for you. This aligns usage across our SDKs and will enable us to better ship DX improvements in the future. ([#2317](https://github.com/clerk/javascript/pull/2317)) by [@tmilewski](https://github.com/tmilewski) + + Inside your code, search for occurrences like these: + + ```js + import { Clerk } from '@clerk/backend'; + const clerk = Clerk({ secretKey: '...' }); + ``` + + You need to rename the import from `Clerk` to `createClerkClient` and change its usage: + + ```js + import { createClerkClient } from '@clerk/backend'; + const clerk = createClerkClient({ secretKey: '...' }); + ``` + +- - Refactor the `authenticateRequest()` flow to use the new client handshake endpoint. This replaces the previous "interstitial"-based flow. This should improve performance and overall reliability of Clerk's server-side request authentication functionality. ([#2300](https://github.com/clerk/javascript/pull/2300)) by [@BRKalow](https://github.com/BRKalow) + + - `authenticateRequest()` now accepts two arguments, a `Request` object to authenticate and options: + ```ts + authenticateRequest(new Request(...), { secretKey: '...' }) + ``` + +### Minor Changes + +- Introduce Protect for authorization. ([#2170](https://github.com/clerk/javascript/pull/2170)) by [@panteliselef](https://github.com/panteliselef) + + Changes in public APIs: + + - Rename Gate to Protect + - Support for permission checks. (Previously only roles could be used) + - Remove the `experimental` tags and prefixes + - Drop `some` from the `has` utility and Protect. Protect now accepts a `condition` prop where a function is expected with the `has` being exposed as the param. + - Protect can now be used without required props. In this case behaves as ``, if no authorization props are passed. + - `has` will throw an error if neither `permission` or `role` is passed. + - `auth().protect()` for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated. + - inside a page or layout file it will render the nearest `not-found` component set by the developer + - inside a route handler it will return empty response body with a 404 status code + +### Patch Changes + +- Updated dependencies [[`896cb6104`](https://github.com/clerk/javascript/commit/896cb610409f84c0ff7a4f502f0b4ccee1afc157), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8)]: + - @clerk/shared@2.0.0-alpha-v5.6 + ## 1.0.0-alpha-v5.7 ### Major Changes diff --git a/packages/backend/package.json b/packages/backend/package.json index 3ae46239cd0..15136bd7168 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/backend", - "version": "1.0.0-alpha-v5.7", + "version": "1.0.0-alpha-v5.8", "description": "Clerk Backend SDK - REST Client for Backend API & JWT verification utilities", "homepage": "https://clerk.com/", "bugs": { @@ -48,13 +48,13 @@ "test:cloudflare-workerd": "tests/cloudflare-workerd/run.sh" }, "dependencies": { - "@clerk/shared": "2.0.0-alpha-v5.5", + "@clerk/shared": "2.0.0-alpha-v5.6", "cookie": "0.5.0", "snakecase-keys": "5.4.4", "tslib": "2.4.1" }, "devDependencies": { - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/types": "4.0.0-alpha-v5.10", "@cloudflare/workers-types": "^3.18.0", "@types/chai": "^4.3.3", "@types/cookie": "^0.5.1", diff --git a/packages/chrome-extension/CHANGELOG.md b/packages/chrome-extension/CHANGELOG.md index c217515914a..355c6de6cf6 100644 --- a/packages/chrome-extension/CHANGELOG.md +++ b/packages/chrome-extension/CHANGELOG.md @@ -1,5 +1,128 @@ # Change Log +## 1.0.0-alpha-v5.10 + +### Major Changes + +- - Introduce `@clerk/clerk-react/errors` and `@clerk/clerk-react/internal` subpath exports to expose some internal utilities. Eg ([#2328](https://github.com/clerk/javascript/pull/2328)) by [@dimkl](https://github.com/dimkl) + + ```typescript + // Before + import { __internal__setErrorThrowerOptions } from '@clerk/clerk-react'; + // After + import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; + + // Before + import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/clerk-react'; + // After + import { + isClerkAPIResponseError, + isEmailLinkError, + isKnownError, + isMetamaskError, + } from '@clerk/clerk-react/errors'; + + // Before + import { MultisessionAppSupport } from '@clerk/clerk-react'; + // After + import { MultisessionAppSupport } from '@clerk/clerk-react/internal'; + ``` + + - Drop from the `@clerk/clerk-react` and all other clerk-react wrapper packages: + - `__internal__setErrorThrowerOptions` internal utility (moved to /internal subpath) + - `WithClerkProp` type + - `MultisessionAppSupport` component (moved to /internal subpath) + - `EmailLinkErrorCode` enum + - Drop `StructureContext` and related errors to reduce to reduce code complexity since it seems that it was not being used. + - Drop `withUser`, `WithUser`, `withClerk` HOFs and `WithClerk`, `withSession`, `WithSession` HOCs from the `@clerk/clerk-react` + to reduce the export surface since it's trivial to implement if needed. + +- Expand the ability for `@clerk/chrome-extension` WebSSO to sync with host applications which use URL-based session syncing. ([#2277](https://github.com/clerk/javascript/pull/2277)) by [@tmilewski](https://github.com/tmilewski) + + ### How to Update + + **WebSSO Host Permissions:** + + _Local Development: You must have your explicit development domain added to your `manifest.json` file in order to use the WebSSO flow._ + + Example: + + ```json + { + "host_permissions": [ + // ... + "http://localhost" + // ... + ] + } + ``` + + _Production: You must have your explicit Clerk Frontend API domain added to your `manifest.json` file in order to use the WebSSO flow._ + + Example: + + ```json + { + "host_permissions": [ + // ... + "https://clerk.example.com" + // ... + ] + } + ``` + + **WebSSO Provider settings:** + + ```tsx + navigate(to)} + routerReplace={to => navigate(to, { replace: true })} + syncSessionWithTab + + // tokenCache is now storageCache (See below) + storageCache={/* ... */} + > + ``` + + **WebSSO Storage Cache Interface:** + + With the prop change from `tokenCache` to `storageCache`, the interface has been expanded to allow for more flexibility. + + The new interface is as follows: + + ```ts + type StorageCache = { + createKey: (...keys: string[]) => string; + get: (key: string) => Promise; + remove: (key: string) => Promise; + set: (key: string, value: string) => Promise; + }; + ``` + +### Minor Changes + +- Introduce Protect for authorization. ([#2170](https://github.com/clerk/javascript/pull/2170)) by [@panteliselef](https://github.com/panteliselef) + + Changes in public APIs: + + - Rename Gate to Protect + - Support for permission checks. (Previously only roles could be used) + - Remove the `experimental` tags and prefixes + - Drop `some` from the `has` utility and Protect. Protect now accepts a `condition` prop where a function is expected with the `has` being exposed as the param. + - Protect can now be used without required props. In this case behaves as ``, if no authorization props are passed. + - `has` will throw an error if neither `permission` or `role` is passed. + - `auth().protect()` for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated. + - inside a page or layout file it will render the nearest `not-found` component set by the developer + - inside a route handler it will return empty response body with a 404 status code + +### Patch Changes + +- Updated dependencies [[`69ce3e185`](https://github.com/clerk/javascript/commit/69ce3e185b89283956cb711629bc61703166b1c9), [`896cb6104`](https://github.com/clerk/javascript/commit/896cb610409f84c0ff7a4f502f0b4ccee1afc157), [`8aea39cd6`](https://github.com/clerk/javascript/commit/8aea39cd6907e3a8ac01091aa6df64ebd6a42ed2), [`ab4eb56a5`](https://github.com/clerk/javascript/commit/ab4eb56a5c34baf496ebb8ac412ad6171b9bd79c), [`46040a2f3`](https://github.com/clerk/javascript/commit/46040a2f34d0991072fca490e031c1994b2e2296), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8), [`844847e0b`](https://github.com/clerk/javascript/commit/844847e0becf20243fba3c659b2b77a238dd270a)]: + - @clerk/clerk-js@5.0.0-alpha-v5.10 + - @clerk/shared@2.0.0-alpha-v5.6 + - @clerk/clerk-react@5.0.0-alpha-v5.10 + ## 1.0.0-alpha-v5.9 ### Patch Changes diff --git a/packages/chrome-extension/package.json b/packages/chrome-extension/package.json index 9317286f1e4..f09d118652d 100644 --- a/packages/chrome-extension/package.json +++ b/packages/chrome-extension/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/chrome-extension", - "version": "1.0.0-alpha-v5.9", + "version": "1.0.0-alpha-v5.10", "description": "Clerk SDK for Chrome extensions", "keywords": [ "auth", @@ -44,9 +44,9 @@ "test:coverage": "jest --collectCoverage && open coverage/lcov-report/index.html" }, "dependencies": { - "@clerk/clerk-js": "5.0.0-alpha-v5.9", - "@clerk/clerk-react": "5.0.0-alpha-v5.9", - "@clerk/shared": "2.0.0-alpha-v5.5", + "@clerk/clerk-js": "5.0.0-alpha-v5.10", + "@clerk/clerk-react": "5.0.0-alpha-v5.10", + "@clerk/shared": "2.0.0-alpha-v5.6", "webextension-polyfill": "^0.10.0" }, "devDependencies": { diff --git a/packages/clerk-js/CHANGELOG.md b/packages/clerk-js/CHANGELOG.md index 495465a6282..d032b7d63b4 100644 --- a/packages/clerk-js/CHANGELOG.md +++ b/packages/clerk-js/CHANGELOG.md @@ -1,5 +1,44 @@ # Change Log +## 5.0.0-alpha-v5.10 + +### Major Changes + +- Drop `redirectToHome` redirect method in favour of `redirectToAfterSignUp` or `redirectToAfterSignIn`. ([#2251](https://github.com/clerk/javascript/pull/2251)) by [@octoper](https://github.com/octoper) + + When the `` and `` components are rendered while a user is already logged in, they will now redirect to the configured `afterSignIn` and `afterSignUp` URLs, respectively. Previously, the redirect URL was set to the home URL configured in the dashboard. + +### Minor Changes + +- Introduce Protect for authorization. ([#2170](https://github.com/clerk/javascript/pull/2170)) by [@panteliselef](https://github.com/panteliselef) + + Changes in public APIs: + + - Rename Gate to Protect + - Support for permission checks. (Previously only roles could be used) + - Remove the `experimental` tags and prefixes + - Drop `some` from the `has` utility and Protect. Protect now accepts a `condition` prop where a function is expected with the `has` being exposed as the param. + - Protect can now be used without required props. In this case behaves as ``, if no authorization props are passed. + - `has` will throw an error if neither `permission` or `role` is passed. + - `auth().protect()` for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated. + - inside a page or layout file it will render the nearest `not-found` component set by the developer + - inside a route handler it will return empty response body with a 404 status code + +### Patch Changes + +- Update `@zxcvbn-ts/core` from `2.2.1` to `3.0.4`. Update `@zxcvbn-ts/language-common` from `3.0.2` to `3.0.4`. ([#2326](https://github.com/clerk/javascript/pull/2326)) by [@LekoArts](https://github.com/LekoArts) + +- Add `useAssertWrappedByClerkProvider` to internal code. If you use hooks like `useAuth` outside of the `` context an error will be thrown. For example: ([#2299](https://github.com/clerk/javascript/pull/2299)) by [@tmilewski](https://github.com/tmilewski) + + ```shell + @clerk/clerk-react: useAuth can only be used within the component + ``` + +- Updated dependencies [[`896cb6104`](https://github.com/clerk/javascript/commit/896cb610409f84c0ff7a4f502f0b4ccee1afc157), [`69ce3e185`](https://github.com/clerk/javascript/commit/69ce3e185b89283956cb711629bc61703166b1c9), [`ab4eb56a5`](https://github.com/clerk/javascript/commit/ab4eb56a5c34baf496ebb8ac412ad6171b9bd79c), [`46040a2f3`](https://github.com/clerk/javascript/commit/46040a2f34d0991072fca490e031c1994b2e2296), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8), [`370b17b12`](https://github.com/clerk/javascript/commit/370b17b123c22aab2915207aad8cbc37c06cfa26), [`844847e0b`](https://github.com/clerk/javascript/commit/844847e0becf20243fba3c659b2b77a238dd270a)]: + - @clerk/shared@2.0.0-alpha-v5.6 + - @clerk/types@4.0.0-alpha-v5.10 + - @clerk/localizations@2.0.0-alpha-v5.7 + ## 5.0.0-alpha-v5.9 ### Major Changes diff --git a/packages/clerk-js/package.json b/packages/clerk-js/package.json index 2bdef3e036c..3c11512014d 100644 --- a/packages/clerk-js/package.json +++ b/packages/clerk-js/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/clerk-js", - "version": "5.0.0-alpha-v5.9", + "version": "5.0.0-alpha-v5.10", "description": "Clerk JS library", "keywords": [ "clerk", @@ -50,9 +50,9 @@ }, "browserslist": "last 2 versions, ios_saf > 12, Safari > 12, > 1%, not dead, not ie > 0", "dependencies": { - "@clerk/localizations": "2.0.0-alpha-v5.6", - "@clerk/shared": "2.0.0-alpha-v5.5", - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/localizations": "2.0.0-alpha-v5.7", + "@clerk/shared": "2.0.0-alpha-v5.6", + "@clerk/types": "4.0.0-alpha-v5.10", "@emotion/cache": "11.11.0", "@emotion/react": "11.11.1", "@floating-ui/react": "0.25.4", diff --git a/packages/expo/CHANGELOG.md b/packages/expo/CHANGELOG.md index bcf4a7bb49f..b9953fa6f3e 100644 --- a/packages/expo/CHANGELOG.md +++ b/packages/expo/CHANGELOG.md @@ -1,5 +1,49 @@ # Change Log +## 1.0.0-alpha-v5.10 + +### Major Changes + +- - Introduce `@clerk/clerk-react/errors` and `@clerk/clerk-react/internal` subpath exports to expose some internal utilities. Eg ([#2328](https://github.com/clerk/javascript/pull/2328)) by [@dimkl](https://github.com/dimkl) + + ```typescript + // Before + import { __internal__setErrorThrowerOptions } from '@clerk/clerk-react'; + // After + import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; + + // Before + import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/clerk-react'; + // After + import { + isClerkAPIResponseError, + isEmailLinkError, + isKnownError, + isMetamaskError, + } from '@clerk/clerk-react/errors'; + + // Before + import { MultisessionAppSupport } from '@clerk/clerk-react'; + // After + import { MultisessionAppSupport } from '@clerk/clerk-react/internal'; + ``` + + - Drop from the `@clerk/clerk-react` and all other clerk-react wrapper packages: + - `__internal__setErrorThrowerOptions` internal utility (moved to /internal subpath) + - `WithClerkProp` type + - `MultisessionAppSupport` component (moved to /internal subpath) + - `EmailLinkErrorCode` enum + - Drop `StructureContext` and related errors to reduce to reduce code complexity since it seems that it was not being used. + - Drop `withUser`, `WithUser`, `withClerk` HOFs and `WithClerk`, `withSession`, `WithSession` HOCs from the `@clerk/clerk-react` + to reduce the export surface since it's trivial to implement if needed. + +### Patch Changes + +- Updated dependencies [[`69ce3e185`](https://github.com/clerk/javascript/commit/69ce3e185b89283956cb711629bc61703166b1c9), [`896cb6104`](https://github.com/clerk/javascript/commit/896cb610409f84c0ff7a4f502f0b4ccee1afc157), [`8aea39cd6`](https://github.com/clerk/javascript/commit/8aea39cd6907e3a8ac01091aa6df64ebd6a42ed2), [`ab4eb56a5`](https://github.com/clerk/javascript/commit/ab4eb56a5c34baf496ebb8ac412ad6171b9bd79c), [`46040a2f3`](https://github.com/clerk/javascript/commit/46040a2f34d0991072fca490e031c1994b2e2296), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8), [`844847e0b`](https://github.com/clerk/javascript/commit/844847e0becf20243fba3c659b2b77a238dd270a)]: + - @clerk/clerk-js@5.0.0-alpha-v5.10 + - @clerk/shared@2.0.0-alpha-v5.6 + - @clerk/clerk-react@5.0.0-alpha-v5.10 + ## 1.0.0-alpha-v5.9 ### Patch Changes diff --git a/packages/expo/package.json b/packages/expo/package.json index 94f848c5c43..4e106a7cacc 100644 --- a/packages/expo/package.json +++ b/packages/expo/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/clerk-expo", - "version": "1.0.0-alpha-v5.9", + "version": "1.0.0-alpha-v5.10", "description": "Clerk React Native/Expo library", "keywords": [ "react", @@ -39,14 +39,14 @@ "publish:local": "npx yalc push --replace --sig" }, "dependencies": { - "@clerk/clerk-js": "5.0.0-alpha-v5.9", - "@clerk/clerk-react": "5.0.0-alpha-v5.9", - "@clerk/shared": "2.0.0-alpha-v5.5", + "@clerk/clerk-js": "5.0.0-alpha-v5.10", + "@clerk/clerk-react": "5.0.0-alpha-v5.10", + "@clerk/shared": "2.0.0-alpha-v5.6", "base-64": "^1.0.0", "react-native-url-polyfill": "2.0.0" }, "devDependencies": { - "@clerk/types": "^4.0.0-alpha-v5.9", + "@clerk/types": "^4.0.0-alpha-v5.10", "@types/base-64": "^1.0.2", "@types/node": "^18.17.0", "@types/react": "*", diff --git a/packages/fastify/CHANGELOG.md b/packages/fastify/CHANGELOG.md index 65b5f2bf779..88c3b049445 100644 --- a/packages/fastify/CHANGELOG.md +++ b/packages/fastify/CHANGELOG.md @@ -1,5 +1,32 @@ # Change Log +## 1.0.0-alpha-v5.10 + +### Major Changes + +- (Note: This is only relevant if, in the unlikely case, you are using `Clerk` from `@clerk/fastify` directly. If not, you can safely ignore this change.) ([#2317](https://github.com/clerk/javascript/pull/2317)) by [@tmilewski](https://github.com/tmilewski) + + Remove the named `Clerk` import from `@clerk/fastify` and import `createClerkClient` instead. The latter is a factory method to create a Clerk client instance for you. This update aligns usage across our SDKs and will enable us to ship DX improvements better in the future. + + ```js + import { Clerk } from '@clerk/fastify'; + const clerk = Clerk({ secretKey: '...' }); + ``` + + You need to rename the import from `Clerk` to `createClerkClient` and change its usage: + + ```js + import { createClerkClient } from '@clerk/fastify'; + const clerk = createClerkClient({ secretKey: '...' }); + ``` + +### Patch Changes + +- Updated dependencies [[`896cb6104`](https://github.com/clerk/javascript/commit/896cb610409f84c0ff7a4f502f0b4ccee1afc157), [`02976d494`](https://github.com/clerk/javascript/commit/02976d49473958b8c3fea38d4e389dc1bee7e8c4), [`69ce3e185`](https://github.com/clerk/javascript/commit/69ce3e185b89283956cb711629bc61703166b1c9), [`86d52fb5c`](https://github.com/clerk/javascript/commit/86d52fb5cf68f1dc7adf617605b922134e21268f), [`ab4eb56a5`](https://github.com/clerk/javascript/commit/ab4eb56a5c34baf496ebb8ac412ad6171b9bd79c), [`46040a2f3`](https://github.com/clerk/javascript/commit/46040a2f34d0991072fca490e031c1994b2e2296), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8), [`844847e0b`](https://github.com/clerk/javascript/commit/844847e0becf20243fba3c659b2b77a238dd270a)]: + - @clerk/shared@2.0.0-alpha-v5.6 + - @clerk/backend@1.0.0-alpha-v5.8 + - @clerk/types@4.0.0-alpha-v5.10 + ## 1.0.0-alpha-v5.9 ### Patch Changes diff --git a/packages/fastify/package.json b/packages/fastify/package.json index 63bbc9222f2..7a3f4cefe27 100644 --- a/packages/fastify/package.json +++ b/packages/fastify/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/fastify", - "version": "1.0.0-alpha-v5.9", + "version": "1.0.0-alpha-v5.10", "description": "Clerk SDK for Fastify", "keywords": [ "auth", @@ -40,9 +40,9 @@ "test:cache:clear": "jest --clearCache --useStderr" }, "dependencies": { - "@clerk/backend": "1.0.0-alpha-v5.7", - "@clerk/shared": "2.0.0-alpha-v5.5", - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/backend": "1.0.0-alpha-v5.8", + "@clerk/shared": "2.0.0-alpha-v5.6", + "@clerk/types": "4.0.0-alpha-v5.10", "cookies": "0.8.0" }, "devDependencies": { diff --git a/packages/gatsby-plugin-clerk/CHANGELOG.md b/packages/gatsby-plugin-clerk/CHANGELOG.md index 6acec8ed3ec..f76f9921677 100644 --- a/packages/gatsby-plugin-clerk/CHANGELOG.md +++ b/packages/gatsby-plugin-clerk/CHANGELOG.md @@ -1,5 +1,65 @@ # Change Log +## 5.0.0-alpha-v5.10 + +### Major Changes + +- Remove the named `Clerk` import from `gatsby-plugin-clerk` and import `createClerkClient` instead. The latter is a factory method to create a Clerk client instance for you. This update aligns usage across our SDKs and will enable us to ship DX improvements better in the future. ([#2317](https://github.com/clerk/javascript/pull/2317)) by [@tmilewski](https://github.com/tmilewski) + + Inside your code, search for occurrences like these: + + ```js + import { Clerk } from 'gatsby-plugin-clerk'; + const clerk = Clerk({ secretKey: '...' }); + ``` + + You need to rename the import from `Clerk` to `createClerkClient` and change its usage: + + ```js + import { createClerkClient } from 'gatsby-plugin-clerk'; + const clerk = createClerkClient({ secretKey: '...' }); + ``` + +- - Introduce `@clerk/clerk-react/errors` and `@clerk/clerk-react/internal` subpath exports to expose some internal utilities. Eg ([#2328](https://github.com/clerk/javascript/pull/2328)) by [@dimkl](https://github.com/dimkl) + + ```typescript + // Before + import { __internal__setErrorThrowerOptions } from '@clerk/clerk-react'; + // After + import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; + + // Before + import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/clerk-react'; + // After + import { + isClerkAPIResponseError, + isEmailLinkError, + isKnownError, + isMetamaskError, + } from '@clerk/clerk-react/errors'; + + // Before + import { MultisessionAppSupport } from '@clerk/clerk-react'; + // After + import { MultisessionAppSupport } from '@clerk/clerk-react/internal'; + ``` + + - Drop from the `@clerk/clerk-react` and all other clerk-react wrapper packages: + - `__internal__setErrorThrowerOptions` internal utility (moved to /internal subpath) + - `WithClerkProp` type + - `MultisessionAppSupport` component (moved to /internal subpath) + - `EmailLinkErrorCode` enum + - Drop `StructureContext` and related errors to reduce to reduce code complexity since it seems that it was not being used. + - Drop `withUser`, `WithUser`, `withClerk` HOFs and `WithClerk`, `withSession`, `WithSession` HOCs from the `@clerk/clerk-react` + to reduce the export surface since it's trivial to implement if needed. + +### Patch Changes + +- Updated dependencies [[`02976d494`](https://github.com/clerk/javascript/commit/02976d49473958b8c3fea38d4e389dc1bee7e8c4), [`02976d494`](https://github.com/clerk/javascript/commit/02976d49473958b8c3fea38d4e389dc1bee7e8c4), [`8aea39cd6`](https://github.com/clerk/javascript/commit/8aea39cd6907e3a8ac01091aa6df64ebd6a42ed2), [`86d52fb5c`](https://github.com/clerk/javascript/commit/86d52fb5cf68f1dc7adf617605b922134e21268f), [`ab4eb56a5`](https://github.com/clerk/javascript/commit/ab4eb56a5c34baf496ebb8ac412ad6171b9bd79c), [`46040a2f3`](https://github.com/clerk/javascript/commit/46040a2f34d0991072fca490e031c1994b2e2296), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8), [`844847e0b`](https://github.com/clerk/javascript/commit/844847e0becf20243fba3c659b2b77a238dd270a)]: + - @clerk/clerk-sdk-node@5.0.0-alpha-v5.8 + - @clerk/backend@1.0.0-alpha-v5.8 + - @clerk/clerk-react@5.0.0-alpha-v5.10 + ## 5.0.0-alpha-v5.9 ### Patch Changes diff --git a/packages/gatsby-plugin-clerk/package.json b/packages/gatsby-plugin-clerk/package.json index 9a4d222b0f5..9c47b58acab 100644 --- a/packages/gatsby-plugin-clerk/package.json +++ b/packages/gatsby-plugin-clerk/package.json @@ -1,6 +1,6 @@ { "name": "gatsby-plugin-clerk", - "version": "5.0.0-alpha-v5.9", + "version": "5.0.0-alpha-v5.10", "description": "Clerk SDK for Gatsby", "keywords": [ "clerk", @@ -44,14 +44,14 @@ "publish:local": "npx yalc push --replace --sig" }, "dependencies": { - "@clerk/backend": "1.0.0-alpha-v5.7", - "@clerk/clerk-react": "5.0.0-alpha-v5.9", - "@clerk/clerk-sdk-node": "5.0.0-alpha-v5.7", + "@clerk/backend": "1.0.0-alpha-v5.8", + "@clerk/clerk-react": "5.0.0-alpha-v5.10", + "@clerk/clerk-sdk-node": "5.0.0-alpha-v5.8", "cookie": "0.5.0", "tslib": "2.4.1" }, "devDependencies": { - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/types": "4.0.0-alpha-v5.10", "@types/cookie": "^0.5.0", "@types/node": "^18.17.0", "eslint-config-custom": "*", diff --git a/packages/localizations/CHANGELOG.md b/packages/localizations/CHANGELOG.md index e22596f1257..ec10edaf89e 100644 --- a/packages/localizations/CHANGELOG.md +++ b/packages/localizations/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 2.0.0-alpha-v5.7 + +### Patch Changes + +- Update es-ES.ts ([#2341](https://github.com/clerk/javascript/pull/2341)) by [@codesjedi](https://github.com/codesjedi) + ## 2.0.0-alpha-v5.6 ### Patch Changes diff --git a/packages/localizations/package.json b/packages/localizations/package.json index 6be7ec77cb9..51a7fce61fd 100644 --- a/packages/localizations/package.json +++ b/packages/localizations/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/localizations", - "version": "2.0.0-alpha-v5.6", + "version": "2.0.0-alpha-v5.7", "description": "Localizations for the Clerk components", "keywords": [ "react", @@ -87,7 +87,7 @@ "lint": "eslint src/" }, "devDependencies": { - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/types": "4.0.0-alpha-v5.10", "@types/node": "^18.17.0", "eslint-config-custom": "*", "tsup": "*", diff --git a/packages/nextjs/CHANGELOG.md b/packages/nextjs/CHANGELOG.md index 8c692aaa083..f58519b2f27 100644 --- a/packages/nextjs/CHANGELOG.md +++ b/packages/nextjs/CHANGELOG.md @@ -1,5 +1,96 @@ # Change Log +## 5.0.0-alpha-v5.10 + +### Major Changes + +- - Introduce `@clerk/clerk-react/errors` and `@clerk/clerk-react/internal` subpath exports to expose some internal utilities. Eg ([#2328](https://github.com/clerk/javascript/pull/2328)) by [@dimkl](https://github.com/dimkl) + + ```typescript + // Before + import { __internal__setErrorThrowerOptions } from '@clerk/clerk-react'; + // After + import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; + + // Before + import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/clerk-react'; + // After + import { + isClerkAPIResponseError, + isEmailLinkError, + isKnownError, + isMetamaskError, + } from '@clerk/clerk-react/errors'; + + // Before + import { MultisessionAppSupport } from '@clerk/clerk-react'; + // After + import { MultisessionAppSupport } from '@clerk/clerk-react/internal'; + ``` + + - Drop from the `@clerk/clerk-react` and all other clerk-react wrapper packages: + - `__internal__setErrorThrowerOptions` internal utility (moved to /internal subpath) + - `WithClerkProp` type + - `MultisessionAppSupport` component (moved to /internal subpath) + - `EmailLinkErrorCode` enum + - Drop `StructureContext` and related errors to reduce to reduce code complexity since it seems that it was not being used. + - Drop `withUser`, `WithUser`, `withClerk` HOFs and `WithClerk`, `withSession`, `WithSession` HOCs from the `@clerk/clerk-react` + to reduce the export surface since it's trivial to implement if needed. + +- (Note: This is only relevant if, in the unlikely case, you are using `Clerk` from `@clerk/nextjs` directly. If not, you can safely ignore this change.) ([#2317](https://github.com/clerk/javascript/pull/2317)) by [@tmilewski](https://github.com/tmilewski) + + Remove the named `Clerk` import from `@clerk/nextjs` and import `createClerkClient` instead. The latter is a factory method to create a Clerk client instance for you. This update aligns usage across our SDKs and will enable us to ship DX improvements better in the future. + + ```js + import { Clerk } from '@clerk/nextjs'; + const clerk = Clerk({ secretKey: '...' }); + ``` + + You need to rename the import from `Clerk` to `createClerkClient` and change its usage: + + ```js + import { createClerkClient } from '@clerk/nextjs'; + const clerk = createClerkClient({ secretKey: '...' }); + ``` + +### Minor Changes + +- Introduce Protect for authorization. ([#2170](https://github.com/clerk/javascript/pull/2170)) by [@panteliselef](https://github.com/panteliselef) + + Changes in public APIs: + + - Rename Gate to Protect + - Support for permission checks. (Previously only roles could be used) + - Remove the `experimental` tags and prefixes + - Drop `some` from the `has` utility and Protect. Protect now accepts a `condition` prop where a function is expected with the `has` being exposed as the param. + - Protect can now be used without required props. In this case behaves as ``, if no authorization props are passed. + - `has` will throw an error if neither `permission` or `role` is passed. + - `auth().protect()` for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated. + - inside a page or layout file it will render the nearest `not-found` component set by the developer + - inside a route handler it will return empty response body with a 404 status code + +### Patch Changes + +- Update NextJS quickstart link in error message ([#2355](https://github.com/clerk/javascript/pull/2355)) by [@dimkl](https://github.com/dimkl) + +- Accept `redirectUrl` as an option for `auth().protect()`. ([#2329](https://github.com/clerk/javascript/pull/2329)) by [@panteliselef](https://github.com/panteliselef) + + For example: + + ```ts + // Authorization + auth().protect({ role: 'org:admin' }, { redirectUrl: '/any-page' }); + auth().protect({ permission: 'org:settings:manage' }, { redirectUrl: '/any-page' }); + + // Authentication + auth().protect({ redirectUrl: '/any-page' }); + ``` + +- Updated dependencies [[`896cb6104`](https://github.com/clerk/javascript/commit/896cb610409f84c0ff7a4f502f0b4ccee1afc157), [`02976d494`](https://github.com/clerk/javascript/commit/02976d49473958b8c3fea38d4e389dc1bee7e8c4), [`8aea39cd6`](https://github.com/clerk/javascript/commit/8aea39cd6907e3a8ac01091aa6df64ebd6a42ed2), [`86d52fb5c`](https://github.com/clerk/javascript/commit/86d52fb5cf68f1dc7adf617605b922134e21268f), [`ab4eb56a5`](https://github.com/clerk/javascript/commit/ab4eb56a5c34baf496ebb8ac412ad6171b9bd79c), [`46040a2f3`](https://github.com/clerk/javascript/commit/46040a2f34d0991072fca490e031c1994b2e2296), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8), [`844847e0b`](https://github.com/clerk/javascript/commit/844847e0becf20243fba3c659b2b77a238dd270a)]: + - @clerk/shared@2.0.0-alpha-v5.6 + - @clerk/backend@1.0.0-alpha-v5.8 + - @clerk/clerk-react@5.0.0-alpha-v5.10 + ## 5.0.0-alpha-v5.9 ### Major Changes diff --git a/packages/nextjs/package.json b/packages/nextjs/package.json index 36fe82a0a93..030f0f51d81 100644 --- a/packages/nextjs/package.json +++ b/packages/nextjs/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/nextjs", - "version": "5.0.0-alpha-v5.9", + "version": "5.0.0-alpha-v5.10", "description": "Clerk SDK for NextJS", "keywords": [ "clerk", @@ -58,13 +58,13 @@ "test:ci": "jest --maxWorkers=70%" }, "dependencies": { - "@clerk/backend": "1.0.0-alpha-v5.7", - "@clerk/clerk-react": "5.0.0-alpha-v5.9", - "@clerk/shared": "2.0.0-alpha-v5.5", + "@clerk/backend": "1.0.0-alpha-v5.8", + "@clerk/clerk-react": "5.0.0-alpha-v5.10", + "@clerk/shared": "2.0.0-alpha-v5.6", "path-to-regexp": "6.2.1" }, "devDependencies": { - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/types": "4.0.0-alpha-v5.10", "@types/node": "^18.17.0", "@types/react": "*", "@types/react-dom": "*", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 4874265c2ba..a00b4f9d899 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,83 @@ # Change Log +## 5.0.0-alpha-v5.10 + +### Major Changes + +- - Introduce `@clerk/clerk-react/errors` and `@clerk/clerk-react/internal` subpath exports to expose some internal utilities. Eg ([#2328](https://github.com/clerk/javascript/pull/2328)) by [@dimkl](https://github.com/dimkl) + + ```typescript + // Before + import { __internal__setErrorThrowerOptions } from '@clerk/clerk-react'; + // After + import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; + + // Before + import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/clerk-react'; + // After + import { + isClerkAPIResponseError, + isEmailLinkError, + isKnownError, + isMetamaskError, + } from '@clerk/clerk-react/errors'; + + // Before + import { MultisessionAppSupport } from '@clerk/clerk-react'; + // After + import { MultisessionAppSupport } from '@clerk/clerk-react/internal'; + ``` + + - Drop from the `@clerk/clerk-react` and all other clerk-react wrapper packages: + - `__internal__setErrorThrowerOptions` internal utility (moved to /internal subpath) + - `WithClerkProp` type + - `MultisessionAppSupport` component (moved to /internal subpath) + - `EmailLinkErrorCode` enum + - Drop `StructureContext` and related errors to reduce to reduce code complexity since it seems that it was not being used. + - Drop `withUser`, `WithUser`, `withClerk` HOFs and `WithClerk`, `withSession`, `WithSession` HOCs from the `@clerk/clerk-react` + to reduce the export surface since it's trivial to implement if needed. + +- Drop `redirectToHome` redirect method in favour of `redirectToAfterSignUp` or `redirectToAfterSignIn`. ([#2251](https://github.com/clerk/javascript/pull/2251)) by [@octoper](https://github.com/octoper) + + When the `` and `` components are rendered while a user is already logged in, they will now redirect to the configured `afterSignIn` and `afterSignUp` URLs, respectively. Previously, the redirect URL was set to the home URL configured in the dashboard. + +- Align return types for redirectTo\* methods in ClerkJS [SDK-1037] ([#2316](https://github.com/clerk/javascript/pull/2316)) by [@tmilewski](https://github.com/tmilewski) + + Breaking Changes: + + - `redirectToUserProfile` now returns `Promise` instead of `void` + - `redirectToOrganizationProfile` now returns `Promise` instead of `void` + - `redirectToCreateOrganization` now returns `Promise` instead of `void` + - `redirectToHome` now returns `Promise` instead of `void` + +### Minor Changes + +- Introduce Protect for authorization. ([#2170](https://github.com/clerk/javascript/pull/2170)) by [@panteliselef](https://github.com/panteliselef) + + Changes in public APIs: + + - Rename Gate to Protect + - Support for permission checks. (Previously only roles could be used) + - Remove the `experimental` tags and prefixes + - Drop `some` from the `has` utility and Protect. Protect now accepts a `condition` prop where a function is expected with the `has` being exposed as the param. + - Protect can now be used without required props. In this case behaves as ``, if no authorization props are passed. + - `has` will throw an error if neither `permission` or `role` is passed. + - `auth().protect()` for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated. + - inside a page or layout file it will render the nearest `not-found` component set by the developer + - inside a route handler it will return empty response body with a 404 status code + +### Patch Changes + +- Add `useAssertWrappedByClerkProvider` to internal code. If you use hooks like `useAuth` outside of the `` context an error will be thrown. For example: ([#2299](https://github.com/clerk/javascript/pull/2299)) by [@tmilewski](https://github.com/tmilewski) + + ```shell + @clerk/clerk-react: useAuth can only be used within the component + ``` + +- Updated dependencies [[`896cb6104`](https://github.com/clerk/javascript/commit/896cb610409f84c0ff7a4f502f0b4ccee1afc157), [`69ce3e185`](https://github.com/clerk/javascript/commit/69ce3e185b89283956cb711629bc61703166b1c9), [`ab4eb56a5`](https://github.com/clerk/javascript/commit/ab4eb56a5c34baf496ebb8ac412ad6171b9bd79c), [`46040a2f3`](https://github.com/clerk/javascript/commit/46040a2f34d0991072fca490e031c1994b2e2296), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8), [`844847e0b`](https://github.com/clerk/javascript/commit/844847e0becf20243fba3c659b2b77a238dd270a)]: + - @clerk/shared@2.0.0-alpha-v5.6 + - @clerk/types@4.0.0-alpha-v5.10 + ## 5.0.0-alpha-v5.9 ### Major Changes diff --git a/packages/react/package.json b/packages/react/package.json index 1099c63bc38..e94619b86f5 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/clerk-react", - "version": "5.0.0-alpha-v5.9", + "version": "5.0.0-alpha-v5.10", "description": "Clerk React library", "keywords": [ "clerk", @@ -76,8 +76,8 @@ "test:ci": "jest --maxWorkers=70%" }, "dependencies": { - "@clerk/shared": "2.0.0-alpha-v5.5", - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/shared": "2.0.0-alpha-v5.6", + "@clerk/types": "4.0.0-alpha-v5.10", "eslint-config-custom": "*", "semver": "^7.5.4", "tslib": "2.4.1" diff --git a/packages/remix/CHANGELOG.md b/packages/remix/CHANGELOG.md index 02787d2770d..0b1496ae947 100644 --- a/packages/remix/CHANGELOG.md +++ b/packages/remix/CHANGELOG.md @@ -1,5 +1,65 @@ # Change Log +## 4.0.0-alpha-v5.10 + +### Major Changes + +- - Introduce `@clerk/clerk-react/errors` and `@clerk/clerk-react/internal` subpath exports to expose some internal utilities. Eg ([#2328](https://github.com/clerk/javascript/pull/2328)) by [@dimkl](https://github.com/dimkl) + + ```typescript + // Before + import { __internal__setErrorThrowerOptions } from '@clerk/clerk-react'; + // After + import { setErrorThrowerOptions } from '@clerk/clerk-react/internal'; + + // Before + import { isClerkAPIResponseError, isEmailLinkError, isKnownError, isMetamaskError } from '@clerk/clerk-react'; + // After + import { + isClerkAPIResponseError, + isEmailLinkError, + isKnownError, + isMetamaskError, + } from '@clerk/clerk-react/errors'; + + // Before + import { MultisessionAppSupport } from '@clerk/clerk-react'; + // After + import { MultisessionAppSupport } from '@clerk/clerk-react/internal'; + ``` + + - Drop from the `@clerk/clerk-react` and all other clerk-react wrapper packages: + - `__internal__setErrorThrowerOptions` internal utility (moved to /internal subpath) + - `WithClerkProp` type + - `MultisessionAppSupport` component (moved to /internal subpath) + - `EmailLinkErrorCode` enum + - Drop `StructureContext` and related errors to reduce to reduce code complexity since it seems that it was not being used. + - Drop `withUser`, `WithUser`, `withClerk` HOFs and `WithClerk`, `withSession`, `WithSession` HOCs from the `@clerk/clerk-react` + to reduce the export surface since it's trivial to implement if needed. + +- (Note: This is only relevant if, in the unlikely case, you are using `Clerk` from `@clerk/remix` directly. If not, you can safely ignore this change.) ([#2317](https://github.com/clerk/javascript/pull/2317)) by [@tmilewski](https://github.com/tmilewski) + + Remove the named `Clerk` import from `@clerk/remix` and import `createClerkClient` instead. The latter is a factory method to create a Clerk client instance for you. This update aligns usage across our SDKs and will enable us to ship DX improvements better in the future. + + ```js + import { Clerk } from '@clerk/remix'; + const clerk = Clerk({ secretKey: '...' }); + ``` + + You need to rename the import from `Clerk` to `createClerkClient` and change its usage: + + ```js + import { createClerkClient } from '@clerk/remix'; + const clerk = createClerkClient({ secretKey: '...' }); + ``` + +### Patch Changes + +- Updated dependencies [[`896cb6104`](https://github.com/clerk/javascript/commit/896cb610409f84c0ff7a4f502f0b4ccee1afc157), [`02976d494`](https://github.com/clerk/javascript/commit/02976d49473958b8c3fea38d4e389dc1bee7e8c4), [`8aea39cd6`](https://github.com/clerk/javascript/commit/8aea39cd6907e3a8ac01091aa6df64ebd6a42ed2), [`86d52fb5c`](https://github.com/clerk/javascript/commit/86d52fb5cf68f1dc7adf617605b922134e21268f), [`ab4eb56a5`](https://github.com/clerk/javascript/commit/ab4eb56a5c34baf496ebb8ac412ad6171b9bd79c), [`46040a2f3`](https://github.com/clerk/javascript/commit/46040a2f34d0991072fca490e031c1994b2e2296), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8), [`844847e0b`](https://github.com/clerk/javascript/commit/844847e0becf20243fba3c659b2b77a238dd270a)]: + - @clerk/shared@2.0.0-alpha-v5.6 + - @clerk/backend@1.0.0-alpha-v5.8 + - @clerk/clerk-react@5.0.0-alpha-v5.10 + ## 4.0.0-alpha-v5.9 ### Major Changes diff --git a/packages/remix/package.json b/packages/remix/package.json index 0f3f928c052..fb4e5623567 100644 --- a/packages/remix/package.json +++ b/packages/remix/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/remix", - "version": "4.0.0-alpha-v5.9", + "version": "4.0.0-alpha-v5.10", "description": "Clerk SDK for Remix", "keywords": [ "clerk", @@ -69,14 +69,14 @@ "publish:local": "npx yalc push --replace --sig" }, "dependencies": { - "@clerk/backend": "1.0.0-alpha-v5.7", - "@clerk/clerk-react": "5.0.0-alpha-v5.9", - "@clerk/shared": "2.0.0-alpha-v5.5", + "@clerk/backend": "1.0.0-alpha-v5.8", + "@clerk/clerk-react": "5.0.0-alpha-v5.10", + "@clerk/shared": "2.0.0-alpha-v5.6", "cookie": "0.5.0", "tslib": "2.4.1" }, "devDependencies": { - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/types": "4.0.0-alpha-v5.10", "@remix-run/react": "^2.0.0", "@remix-run/server-runtime": "^2.0.0", "@types/cookie": "^0.5.0", diff --git a/packages/sdk-node/CHANGELOG.md b/packages/sdk-node/CHANGELOG.md index b121748eb00..d33df95b46c 100644 --- a/packages/sdk-node/CHANGELOG.md +++ b/packages/sdk-node/CHANGELOG.md @@ -1,5 +1,31 @@ # Change Log +## 5.0.0-alpha-v5.8 + +### Major Changes + +- (Note: This is only relevant if, in the unlikely case, you are using `Clerk` from `@clerk/clerk-sdk-node` directly. If not, you can safely ignore this change.) ([#2317](https://github.com/clerk/javascript/pull/2317)) by [@tmilewski](https://github.com/tmilewski) + + Remove the named `Clerk` import from `@clerk/clerk-sdk-node` and import `createClerkClient` instead. The latter is a factory method to create a Clerk client instance for you. This update aligns usage across our SDKs and will enable us to ship DX improvements better in the future. + + ```js + import { Clerk } from '@clerk/clerk-sdk-node'; + const clerk = Clerk({ secretKey: '...' }); + ``` + + You need to rename the import from `Clerk` to `createClerkClient` and change its usage: + + ```js + import { createClerkClient } from '@clerk/clerk-sdk-node'; + const clerk = createClerkClient({ secretKey: '...' }); + ``` + +### Patch Changes + +- Updated dependencies [[`896cb6104`](https://github.com/clerk/javascript/commit/896cb610409f84c0ff7a4f502f0b4ccee1afc157), [`02976d494`](https://github.com/clerk/javascript/commit/02976d49473958b8c3fea38d4e389dc1bee7e8c4), [`86d52fb5c`](https://github.com/clerk/javascript/commit/86d52fb5cf68f1dc7adf617605b922134e21268f), [`46040a2f3`](https://github.com/clerk/javascript/commit/46040a2f34d0991072fca490e031c1994b2e2296), [`75ea300bc`](https://github.com/clerk/javascript/commit/75ea300bce16a0ce401a225263bb267ad2a217b8)]: + - @clerk/shared@2.0.0-alpha-v5.6 + - @clerk/backend@1.0.0-alpha-v5.8 + ## 5.0.0-alpha-v5.7 ### Major Changes diff --git a/packages/sdk-node/package.json b/packages/sdk-node/package.json index 02bcdf739f8..ad5a19009c1 100644 --- a/packages/sdk-node/package.json +++ b/packages/sdk-node/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/clerk-sdk-node", - "version": "5.0.0-alpha-v5.7", + "version": "5.0.0-alpha-v5.8", "description": "Clerk server SDK for usage with node", "keywords": [ "clerk", @@ -53,13 +53,13 @@ "test:ci": "jest --maxWorkers=70%" }, "dependencies": { - "@clerk/backend": "1.0.0-alpha-v5.7", - "@clerk/shared": "2.0.0-alpha-v5.5", + "@clerk/backend": "1.0.0-alpha-v5.8", + "@clerk/shared": "2.0.0-alpha-v5.6", "camelcase-keys": "6.2.2", "snakecase-keys": "3.2.1" }, "devDependencies": { - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/types": "4.0.0-alpha-v5.10", "@types/express": "4.17.14", "@types/node": "^18.17.0", "eslint-config-custom": "*", diff --git a/packages/shared/CHANGELOG.md b/packages/shared/CHANGELOG.md index 31ee91298f6..4206bdaf501 100644 --- a/packages/shared/CHANGELOG.md +++ b/packages/shared/CHANGELOG.md @@ -1,5 +1,17 @@ # Change Log +## 2.0.0-alpha-v5.6 + +### Patch Changes + +- Add `react-dom` to `peerDependenciesMeta` key inside `package.json` ([#2322](https://github.com/clerk/javascript/pull/2322)) by [@LekoArts](https://github.com/LekoArts) + +- Add `useAssertWrappedByClerkProvider` to internal code. If you use hooks like `useAuth` outside of the `` context an error will be thrown. For example: ([#2299](https://github.com/clerk/javascript/pull/2299)) by [@tmilewski](https://github.com/tmilewski) + + ```shell + @clerk/clerk-react: useAuth can only be used within the component + ``` + ## 2.0.0-alpha-v5.5 ### Patch Changes diff --git a/packages/shared/package.json b/packages/shared/package.json index 5d728a0a313..defe6907b44 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/shared", - "version": "2.0.0-alpha-v5.5", + "version": "2.0.0-alpha-v5.6", "description": "Internal package utils used by the Clerk SDKs", "repository": { "type": "git", @@ -92,7 +92,7 @@ "swr": "2.2.0" }, "devDependencies": { - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/types": "4.0.0-alpha-v5.10", "@types/glob-to-regexp": "0.4.1", "@types/js-cookie": "3.0.2", "@types/node": "^18.17.0", diff --git a/packages/themes/package.json b/packages/themes/package.json index f8cb89ba41d..2813aa12170 100644 --- a/packages/themes/package.json +++ b/packages/themes/package.json @@ -37,7 +37,7 @@ "lint": "eslint src/" }, "devDependencies": { - "@clerk/types": "4.0.0-alpha-v5.9", + "@clerk/types": "4.0.0-alpha-v5.10", "@types/node": "^18.17.0", "eslint-config-custom": "*", "typescript": "*" diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 73590f0c7c8..30106106e2d 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,5 +1,42 @@ # Change Log +## 4.0.0-alpha-v5.10 + +### Major Changes + +- Align return types for redirectTo\* methods in ClerkJS [SDK-1037] ([#2316](https://github.com/clerk/javascript/pull/2316)) by [@tmilewski](https://github.com/tmilewski) + + Breaking Changes: + + - `redirectToUserProfile` now returns `Promise` instead of `void` + - `redirectToOrganizationProfile` now returns `Promise` instead of `void` + - `redirectToCreateOrganization` now returns `Promise` instead of `void` + - `redirectToHome` now returns `Promise` instead of `void` + +### Minor Changes + +- Introduce Protect for authorization. ([#2170](https://github.com/clerk/javascript/pull/2170)) by [@panteliselef](https://github.com/panteliselef) + + Changes in public APIs: + + - Rename Gate to Protect + - Support for permission checks. (Previously only roles could be used) + - Remove the `experimental` tags and prefixes + - Drop `some` from the `has` utility and Protect. Protect now accepts a `condition` prop where a function is expected with the `has` being exposed as the param. + - Protect can now be used without required props. In this case behaves as ``, if no authorization props are passed. + - `has` will throw an error if neither `permission` or `role` is passed. + - `auth().protect()` for Nextjs App Router. Allow per page protection in app router. This utility will automatically throw a 404 error if user is not authorized or authenticated. + - inside a page or layout file it will render the nearest `not-found` component set by the developer + - inside a route handler it will return empty response body with a 404 status code + +### Patch Changes + +- Adjust `ZxcvbnResult` interface to use current `feedback.warning` type as used in the upstream `@zxcvbn-ts/core` library. ([#2326](https://github.com/clerk/javascript/pull/2326)) by [@LekoArts](https://github.com/LekoArts) + +- Drop `redirectToHome` redirect method in favour of `redirectToAfterSignUp` or `redirectToAfterSignIn`. ([#2251](https://github.com/clerk/javascript/pull/2251)) by [@octoper](https://github.com/octoper) + + When the `` and `` components are rendered while a user is already logged in, they will now redirect to the configured `afterSignIn` and `afterSignUp` URLs, respectively. Previously, the redirect URL was set to the home URL configured in the dashboard. + ## 4.0.0-alpha-v5.9 ### Major Changes diff --git a/packages/types/package.json b/packages/types/package.json index 2937cd1bd34..ef2c12aa8dc 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@clerk/types", - "version": "4.0.0-alpha-v5.9", + "version": "4.0.0-alpha-v5.10", "description": "Typings for Clerk libraries.", "keywords": [ "clerk",