-
Notifications
You must be signed in to change notification settings - Fork 253
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
feat(clerk-js,types,nextjs,remix): Terse path parameters #1957
Conversation
🦋 Changeset detectedLatest commit: 25f9cc8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
85f1cac
to
8daae51
Compare
f31ab32
to
e0bc858
Compare
38f0c70
to
2f488d8
Compare
4d19069
to
69b523d
Compare
a4b9d16
to
23f552d
Compare
11e7ea1
to
00477d4
Compare
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.
Good work! We should add some type tests to make sure this doesn't break in the future since these are some complex types. Check this file for referennce: https://github.com/clerkinc/javascript/blob/3ceb2a734a43f134956164377399fec46e01e0a1/packages/react/src/contexts/__tests__/ClerkProvider.test.tsx
packages/clerk-js/src/ui/components/CreateOrganization/CreateOrganization.tsx
Outdated
Show resolved
Hide resolved
c90d57e
to
d8854b0
Compare
a1f1a08
to
542012a
Compare
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.
@octoper You will need to apply the changes to the ui-retheme dir. I will share more details within the day
…rofile components
60e4ba5
to
cfb1a1e
Compare
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.
I noticed that you updated the next-app-router and the react-vite apps and added the /hash
pages - is there any reason you did not update the rest?
In general, every app in the template dir must have the same interface so we can use the apps interchangeably throughout the tests.
If you want to run a small navigation-focused suite without affecting any templates, you can use an existing applicationConfig
and the addFile
method to programmatically create an app before the tests. The scope of the app will be just that specific test
@@ -112,3 +112,17 @@ export const buildAuthQueryString = (data: BuildAuthQueryStringArgs): string | n | |||
} | |||
return Object.keys(query).length === 0 ? null : qs.stringify(query); | |||
}; | |||
|
|||
export const normalizeRoutingOptions = ({ |
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.
🙃 This file is not just about authPropHelpers
anymore. It is a collection of prop/options parsers and normalizers. So, at some point, we need to rename it.
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.
Noted!
* feat(clerk-js,types,nextjs,remix): Terse paths parameters * chore(repo): Warning instead of erroring for no unused variables rule * chore(repo): Remove changes from NextJS playground * feat(clerk-js,clerk-react,types): Terse params for OrganizationSwitcher and UserButton * fix(clerk-js): Use only userProfileUrl prop to check what userProfileMode should be used * test(clerk-js): Added tests for normalizeRoutingOptions utility function * chore(repo): Added Changeset * feat(clerk-js): Omit routing prop from Modal components * chore(types): Fix typo * fix(clerk-js): Check all falsy values instead of just undefined * test(clerk-js): Fix tests for normalizeRoutingOptions * feat(types): Added WithoutRouting type helper * fix(remix): Revert SignIn and SIgnUp components * chore(clerk-js): Remove uneeded import * fix(remix): Revert changes * fix(remix,nextjs,types): Components with routing * test(clerk-react): Added types tests for SignIn component * test(clerk-react): Added types tests for SignUp component * test(clerk-react): Added types tests for UserButton component * test(clerk-react): Added types tests for OrganizationSwitcher component * test(clerk-react): Added type tests for UserProfile and OrganizationProfile components * feat(clerk-js): Apply changes to ui.retheme * refactor(clerk-js): Make normalizeRoutingOptions more verbose * chore(clerk-js): Remove unedeed type * refactor(clerk-js,types): Add types for modal components * refactor(nextjs,remix): Refactor SignIn/SignUp components for Next and Remix * tests(repo): Add integration tests * chore(repo): Fix formatting * test(repo): Update navigation integration tests * test(repo): Update navigation integration tests * test(repo): Add more test cases for navigation integration tests
Description
This PR introduces some breaking changes
routing
prop assigned with'path'
if thepath
prop is filled. Additionally, the types will be stricter, and if thepath
prop is filled and therouting
prop is filled with a value other than'path'
, TypeScript will throw an error.<UserButton />
component will have theuserProfileMode
prop assigned with'navigation'
by default if theuserProfileUrl
prop is filled. Similarly, the types will be stricter, and if theuserProfileUrl
prop is filled and theuserProfileMode
prop is filled with a value other than'navigation'
, TypeScript will throw an error.<OrganizationSwitcher />
component will have theorganizationProfileMode
andcreateOrganizationMode
props assigned with'navigation'
by default if theorganizationProfileUrl
andcreateOrganizationUrl
props are filled accordingly. Additionally, the types will be stricter, and if theorganizationProfileUrl
orcreateOrganizationUrl
prop is filled and theorganizationProfileMode
orcreateOrganizationMode
prop is filled with a value other than'navigation'
, TypeScript will throw an error.Checklist
npm test
runs as expected.npm run build
runs as expected.Type of change
Packages affected
@clerk/clerk-js
@clerk/clerk-react
@clerk/nextjs
@clerk/remix
@clerk/types
@clerk/themes
@clerk/localizations
@clerk/clerk-expo
@clerk/backend
@clerk/clerk-sdk-node
@clerk/shared
@clerk/fastify
@clerk/chrome-extension
gatsby-plugin-clerk
build/tooling/chore