Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/four-wombats-clean.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@clerk/clerk-js": minor
"@clerk/ui": minor
Comment on lines +2 to +3
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot May 6, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚖️ Poor tradeoff

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Check if enableOrgSelection or __internal_enableOrgSelection 
# were documented as public API or only internal usage.

# Check for public documentation or exports of these props
rg -n --type=md --type=ts -C3 'enableOrgSelection|__internal_enableOrgSelection' \
  -g '!**/__tests__/**' \
  -g '!**/dist/**' \
  -g '!**/node_modules/**'

Repository: clerk/javascript

Length of output: 42


🏁 Script executed:

# Get the git diff for this changeset to see what was actually removed
git diff HEAD~1 HEAD --no-color -p packages/ui/src/types.ts packages/clerk-js/src/index.ts 2>/dev/null | head -100

Repository: clerk/javascript

Length of output: 42


🏁 Script executed:

# Check if the removed types were exported from package.json exports
fd -e 'package.json' -x grep -l "exports" {} \; | xargs grep -l "@clerk/ui\|@clerk/clerk-js" | head -5

Repository: clerk/javascript

Length of output: 42


🏁 Script executed:

# Look for any JSDoc comments indicating public/internal status on OAuthConsent
rg -n 'OAuthConsent|@public|@internal' -B2 -A2 packages/ui/src/types.ts 2>/dev/null || echo "File not found or search failed"

Repository: clerk/javascript

Length of output: 1077


🏁 Script executed:

# Check if there's a git staging area or if this is a draft change
git status --short | head -20

Repository: clerk/javascript

Length of output: 152


🏁 Script executed:

# Look at the actual changeset file to confirm what packages and level are declared
cat .changeset/four-wombats-clean.md

Repository: clerk/javascript

Length of output: 156


Change semver bump level from minor to major.

Both packages are marked as minor changes, but removing OAuthConsentCtx (a publicly exported type with documented "public-path" behavior) is a breaking change that requires a major version bump per semver conventions. External consumers using this type will encounter TypeScript compilation errors after this release.

The PR description labels it "internal," but the type is currently exported from the public API and documented with public-facing behavior comments.

Current changeset
---
"@clerk/clerk-js": minor
"@clerk/ui": minor
---

Removed unused internal OAuthConsent prop.

Change both to major:

---
"@clerk/clerk-js": major
"@clerk/ui": major
---
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/four-wombats-clean.md around lines 2 - 3, The changeset
incorrectly marks "@clerk/clerk-js" and "@clerk/ui" as minor even though the
public type OAuthConsentCtx was removed; update the changeset to bump both
packages to major by replacing the two "minor" entries with "major" and adjust
the YAML block to list "@clerk/clerk-js": major and "@clerk/ui": major so the
breaking change is properly recorded for release.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We only use the prop internally in the clerk dashboard and we already replaced it with a custom scope

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@wobsoriano, thanks for the clarification! That makes sense — since the __internal_ prefix signals it was never part of the public API and external consumers weren't relying on it, the minor bump is correct. Sorry for the noise!


✏️ Learnings added
Learnt from: wobsoriano
Repo: clerk/javascript PR: 8492
File: .changeset/four-wombats-clean.md:2-3
Timestamp: 2026-05-06T20:33:23.537Z
Learning: In the clerk/javascript repository, props prefixed with `__internal_` (e.g., `__internal_enableOrgSelection`) are considered internal-only and are not part of the public API, even if they appear in exported types. Removing such props does not constitute a breaking change and does not require a `major` semver bump — a `minor` or `patch` bump is appropriate.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: wobsoriano
Repo: clerk/javascript PR: 8074
File: .changeset/short-apes-joke.md:1-2
Timestamp: 2026-03-13T21:45:04.714Z
Learning: In the clerk/javascript repository, an empty changeset file (containing only the --- delimiters) is acceptable for documentation-only PRs that do not require a package version bump or changelog entry. This pattern applies to all .changeset markdown files; use the above pattern to cover this scenario. If a changeset is meant to bump a version or add a changelog entry, ensure the file contains the appropriate summary and bump entries; avoid leaving non-empty changesets empty.

---

Removed unused internal OAuthConsent prop.
1 change: 0 additions & 1 deletion packages/clerk-js/sandbox/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,6 @@ void (async () => {
scopes,
oauthClientId: 'Wg9fP2d0pSFXCZ1u',
redirectUrl: searchParams.get('redirect_uri') ?? 'http://localhost:4000/oauth/callback',
__internal_enableOrgSelection: true,
},
);
},
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/OAuthConsent/OAuthConsent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function _OAuthConsent() {
const redirectUrl = ctx.redirectUrl ?? getRedirectUriFromSearch();

const hasOrgReadScope = scopes.some(s => s.scope === USER_ORG_READ_SCOPE);
const orgSelectionEnabled = !!((hasOrgReadScope || ctx.enableOrgSelection) && organizationSettings.enabled);
const orgSelectionEnabled = !!(hasOrgReadScope && organizationSettings.enabled);
const orgOptions = orgSelectionEnabled
? (user?.organizationMemberships ?? []).map(m => ({
value: m.organization.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,25 +390,6 @@ describe('OAuthConsent', () => {
});
});

it('renders the org selector when __internal_enableOrgSelection is true (fallback for existing apps)', async () => {
const { wrapper, fixtures, props } = await createFixtures(f => {
f.withUser({
email_addresses: ['jane@example.com'],
organization_memberships: [{ id: 'org_1', name: 'Acme Corp' }],
});
f.withOrganizations();
});

props.setProps({ componentName: 'OAuthConsent', __internal_enableOrgSelection: true } as any);
mockOAuthApplication(fixtures.clerk, { getConsentInfo: vi.fn().mockResolvedValue(fakeConsentInfo) });

const { getByText } = render(<OAuthConsent />, { wrapper });

await waitFor(() => {
expect(getByText('Acme Corp')).toBeVisible();
});
});

it('does not display user:org:read in the scopes list', async () => {
const { wrapper, fixtures, props } = await createFixtures(f => {
f.withUser({
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/contexts/ClerkUIComponentsContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ export function ComponentContextProvider({
onAllow: p.onAllow,
onDeny: p.onDeny,
appearance: p.appearance,
enableOrgSelection: (p as any).__internal_enableOrgSelection === true,
}}
>
{children}
Expand Down
5 changes: 0 additions & 5 deletions packages/ui/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -225,11 +225,6 @@ export type OAuthConsentCtx = {
* Customize the appearance of the component.
*/
appearance?: ClerkAppearanceTheme;
/**
* When true, renders the organization picker and submits organization_id
* with the consent form. Internal use only, not exposed in the public prop type.
*/
enableOrgSelection?: boolean;
};

export type SubscriptionDetailsCtx = __internal_SubscriptionDetailsProps & {
Expand Down
Loading