Skip to content

Remove stale v1/v2 directory branching and promote v2 as default#2

Open
brionmario wants to merge 1 commit into
thunder-id:mainfrom
brionmario:migrate
Open

Remove stale v1/v2 directory branching and promote v2 as default#2
brionmario wants to merge 1 commit into
thunder-id:mainfrom
brionmario:migrate

Conversation

@brionmario

@brionmario brionmario commented Jun 23, 2026

Copy link
Copy Markdown
Member

Purpose

Removes the legacy v1/v2 platform-dispatch layer from the JavaScript SDKs. v1 targeted the WSO2 Identity Server embedded flow (/api/server/v1/flow/execute) and is no longer needed — ThunderID is now the only supported platform. v2 (ThunderID native flow, /flow/execute) becomes the unconditional default, and all V2-suffixed exports are renamed to their clean equivalents.

⚠️ Breaking Changes

🔧 Summary of Breaking Changes

  • Platform enum and identifyPlatform deleted. Runtime platform-detection (if (platform === Platform.ThunderID)) is removed entirely.
  • All V2-suffixed exports renamed. e.g. EmbeddedFlowComponentTypeV2EmbeddedFlowComponentType, executeEmbeddedSignInFlowV2executeEmbeddedSignInFlow, useOAuthCallbackV2useOAuthCallback.
  • v1-only types deleted. EmbeddedFlowExecuteRequestPayload, EmbeddedFlowExecuteResponse, EmbeddedFlowStatus, EmbeddedSignInFlowHandleRequestPayload are no longer exported.
  • platform prop removed from ThunderIDContext and ThunderIDProviderProps (React + Vue).
  • inheritFromBranding / mode props removed from React ThemeProvider.

💥 Impact

Any consumer that:

  • imports a *V2-suffixed name — compile error; rename to the clean equivalent
  • passes platform to ThunderIDProvider / useThunderID — prop silently ignored → remove it
  • uses Platform, identifyPlatform, or the deleted v1 types — compile error; no replacement
  • passes inheritFromBranding or mode to React ThemeProvider — compile error; remove those props

🔄 Migration Guide

Rename V2-suffixed imports:

// Before
import { EmbeddedFlowComponentTypeV2, executeEmbeddedSignInFlowV2, useOAuthCallbackV2 } from '@thunderid/react';

// After
import { EmbeddedFlowComponentType, executeEmbeddedSignInFlow, useOAuthCallback } from '@thunderid/react';

Remove platform from provider config:

// Before
<ThunderIDProvider platform={Platform.ThunderID} baseUrl="..." clientId="..." />

// After
<ThunderIDProvider baseUrl="..." clientId="..." />

Remove deleted v1 types — use the v2 equivalent:

// Before
import { EmbeddedFlowExecuteRequestPayload, EmbeddedFlowStatus } from '@thunderid/browser';

// After
import { EmbeddedSignUpFlowStatus } from '@thunderid/browser';

Approach

Every package carried a dispatcher pattern — a top-level component or function that checked platform === Platform.ThunderID at runtime and routed to a v1/ or v2/ subdirectory. With only one platform remaining the entire dispatch layer is dead code.

Dispatcher removal: All dispatcher files (e.g. SignIn.tsx, BaseSignIn.tsx, ThemeProvider.tsx) were replaced with thin re-exports pointing directly at the v2/ implementation. The v1/ directories were deleted.

Name promotion: V2-suffixed identifiers were renamed in-place across every package that referenced them — imports, type annotations, enum usages, and dependency arrays — so the public API is clean with no aliases.

Platform plumbing removal: Platform enum, identifyPlatform utility, and the platform field on ThunderIDContext were deleted. FlowMetaProvider (React) previously gated fetches behind platform === Platform.ThunderID; that guard was simplified to the enabled flag alone.

No runtime behaviour changes for ThunderID consumers — the v2 code path was already the active one.

Related Issues

Related PRs

  • N/A

Checklist

  • Followed the contribution guidelines.
  • Manual test round performed and verified.
  • Documentation provided. (Add links if there are any)
  • Tests provided. (Add links if there are any)
    • Unit Tests
    • Integration Tests
  • Breaking changes. (Fill if applicable)
    • Breaking changes section filled.
    • breaking change label added.

Security checks

  • Followed secure coding standards in WSO2 Secure Coding Guidelines
  • Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets.

@brionmario brionmario force-pushed the migrate branch 2 times, most recently from 76158cf to d96d212 Compare June 23, 2026 03:45
@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Too many files!

This PR contains 178 files, which is 28 over the limit of 150.

To get a review, narrow the scope:
• coderabbit review --type committed # exclude uncommitted changes
• coderabbit review --dir # limit to a subdirectory
• coderabbit review --base # compare against a closer base

Upgrade to a paid plan to raise the limit.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: e4174b2c-9ed5-4be2-a35d-5b4d1c3f43f6

📥 Commits

Reviewing files that changed from the base of the PR and between 656cc53 and a17ce3c.

📒 Files selected for processing (178)
  • packages/browser/src/ThunderIDBrowserClient.ts
  • packages/browser/src/index.ts
  • packages/browser/src/utils/resolveEmojiUrisInHtml.ts
  • packages/express/src/middleware/flow.ts
  • packages/javascript/src/ThunderIDJavaScriptClient.ts
  • packages/javascript/src/api/__tests__/executeEmbeddedSignInFlow.test.ts
  • packages/javascript/src/api/__tests__/executeEmbeddedSignUpFlow.test.ts
  • packages/javascript/src/api/__tests__/initializeEmbeddedSignInFlow.test.ts
  • packages/javascript/src/api/executeEmbeddedRecoveryFlow.ts
  • packages/javascript/src/api/executeEmbeddedSignInFlow.ts
  • packages/javascript/src/api/executeEmbeddedSignUpFlow.ts
  • packages/javascript/src/api/executeEmbeddedUserOnboardingFlow.ts
  • packages/javascript/src/api/getBrandingPreference.ts
  • packages/javascript/src/api/getFlowMeta.ts
  • packages/javascript/src/api/getOrganizationUnitChildren.ts
  • packages/javascript/src/api/initializeEmbeddedSignInFlow.ts
  • packages/javascript/src/api/v2/__tests__/executeEmbeddedSignInFlowV2.test.ts
  • packages/javascript/src/api/v2/__tests__/executeEmbeddedSignUpFlowV2.test.ts
  • packages/javascript/src/api/v2/executeEmbeddedSignInFlowV2.ts
  • packages/javascript/src/api/v2/executeEmbeddedSignUpFlowV2.ts
  • packages/javascript/src/constants/v2/OIDCDiscoveryConstants.ts
  • packages/javascript/src/index.ts
  • packages/javascript/src/models/client.ts
  • packages/javascript/src/models/config.ts
  • packages/javascript/src/models/embedded-flow.ts
  • packages/javascript/src/models/embedded-recovery-flow.ts
  • packages/javascript/src/models/embedded-signin-flow.ts
  • packages/javascript/src/models/embedded-signup-flow.ts
  • packages/javascript/src/models/extensions/components.ts
  • packages/javascript/src/models/flow-meta.ts
  • packages/javascript/src/models/organization-unit.ts
  • packages/javascript/src/models/platforms.ts
  • packages/javascript/src/models/translation.ts
  • packages/javascript/src/models/v2/embedded-flow-v2.ts
  • packages/javascript/src/models/v2/embedded-signin-flow-v2.ts
  • packages/javascript/src/models/v2/extensions/components.ts
  • packages/javascript/src/models/vars.ts
  • packages/javascript/src/utils/__tests__/buildValidatorFromRules.test.ts
  • packages/javascript/src/utils/__tests__/evaluateValidationRule.test.ts
  • packages/javascript/src/utils/__tests__/identifyPlatform.test.ts
  • packages/javascript/src/utils/__tests__/injectRequestedPermissions.test.ts
  • packages/javascript/src/utils/__tests__/resolveFieldType.test.ts
  • packages/javascript/src/utils/buildValidatorFromRules.ts
  • packages/javascript/src/utils/containsMetaFlowTemplateLiteral.ts
  • packages/javascript/src/utils/countryCodeToFlagEmoji.ts
  • packages/javascript/src/utils/evaluateValidationRule.ts
  • packages/javascript/src/utils/extractEmojiFromUri.ts
  • packages/javascript/src/utils/getRedirectBasedSignUpUrl.ts
  • packages/javascript/src/utils/identifyPlatform.ts
  • packages/javascript/src/utils/injectRequestedPermissions.ts
  • packages/javascript/src/utils/isEmojiUri.ts
  • packages/javascript/src/utils/isMetaFlowTemplateLiteral.ts
  • packages/javascript/src/utils/isTranslationFlowTemplateLiteral.ts
  • packages/javascript/src/utils/parseFlowTemplateLiteral.ts
  • packages/javascript/src/utils/resolveFieldType.ts
  • packages/javascript/src/utils/resolveFlowTemplateLiterals.ts
  • packages/javascript/src/utils/resolveLocaleDisplayName.ts
  • packages/javascript/src/utils/resolveLocaleEmoji.ts
  • packages/javascript/src/utils/resolveMeta.ts
  • packages/nextjs/src/ThunderIDNextClient.ts
  • packages/nextjs/src/client/components/presentation/SignIn/SignIn.tsx
  • packages/nextjs/src/client/components/presentation/SignUp/SignUp.tsx
  • packages/nextjs/src/client/contexts/ThunderID/ThunderIDProvider.tsx
  • packages/nextjs/src/server/actions/signInAction.ts
  • packages/nextjs/src/server/actions/signUpAction.ts
  • packages/nuxt/src/runtime/components/auth/SignIn.ts
  • packages/nuxt/src/runtime/components/auth/SignUp.ts
  • packages/nuxt/src/runtime/composables/useThunderID.ts
  • packages/nuxt/src/runtime/server/ThunderIDNuxtClient.ts
  • packages/nuxt/src/runtime/server/routes/auth/session/signin.post.ts
  • packages/nuxt/src/runtime/server/routes/auth/session/signup.post.ts
  • packages/nuxt/src/runtime/types.ts
  • packages/nuxt/tests/unit/signin-post.test.ts
  • packages/react/src/ThunderIDReactClient.ts
  • packages/react/src/components/adapters/CheckboxInput.tsx
  • packages/react/src/components/adapters/Consent.tsx
  • packages/react/src/components/adapters/ConsentCheckboxList.tsx
  • packages/react/src/components/adapters/DateInput.tsx
  • packages/react/src/components/adapters/DividerComponent.tsx
  • packages/react/src/components/adapters/EmailInput.tsx
  • packages/react/src/components/adapters/FormContainer.tsx
  • packages/react/src/components/adapters/NumberInput.tsx
  • packages/react/src/components/adapters/PasswordInput.tsx
  • packages/react/src/components/adapters/SelectInput.tsx
  • packages/react/src/components/adapters/SocialButton.tsx
  • packages/react/src/components/adapters/SubmitButton.tsx
  • packages/react/src/components/adapters/TelephoneInput.tsx
  • packages/react/src/components/adapters/TextInput.tsx
  • packages/react/src/components/adapters/Typography.tsx
  • packages/react/src/components/auth/Callback/TokenCallback.tsx
  • packages/react/src/components/factories/FieldFactory.tsx
  • packages/react/src/components/presentation/auth/AcceptInvite/AcceptInvite.tsx
  • packages/react/src/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.ts
  • packages/react/src/components/presentation/auth/AcceptInvite/BaseAcceptInvite.tsx
  • packages/react/src/components/presentation/auth/AcceptInvite/index.ts
  • packages/react/src/components/presentation/auth/AuthOptionFactory.tsx
  • packages/react/src/components/presentation/auth/InviteUser/BaseInviteUser.styles.ts
  • packages/react/src/components/presentation/auth/InviteUser/BaseInviteUser.tsx
  • packages/react/src/components/presentation/auth/InviteUser/InviteUser.tsx
  • packages/react/src/components/presentation/auth/InviteUser/index.ts
  • packages/react/src/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.styles.ts
  • packages/react/src/components/presentation/auth/OrganizationUnitPicker/OrganizationUnitPicker.tsx
  • packages/react/src/components/presentation/auth/OrganizationUnitPicker/index.ts
  • packages/react/src/components/presentation/auth/Recovery/BaseRecovery.tsx
  • packages/react/src/components/presentation/auth/Recovery/Recovery.tsx
  • packages/react/src/components/presentation/auth/Recovery/v1/BaseRecovery.tsx
  • packages/react/src/components/presentation/auth/Recovery/v1/Recovery.tsx
  • packages/react/src/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.tsx
  • packages/react/src/components/presentation/auth/Recovery/v2/BaseRecovery.tsx
  • packages/react/src/components/presentation/auth/Recovery/v2/Recovery.tsx
  • packages/react/src/components/presentation/auth/SignIn/BaseSignIn.tsx
  • packages/react/src/components/presentation/auth/SignIn/SignIn.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/BaseSignIn.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/options/EmailOtp.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/options/IdentifierFirst.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/options/MultiOptionButton.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/options/SmsOtp.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/options/SocialButton.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/options/Totp.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/options/UsernamePassword.tsx
  • packages/react/src/components/presentation/auth/SignIn/v1/types.ts
  • packages/react/src/components/presentation/auth/SignIn/v2/BaseSignIn.tsx
  • packages/react/src/components/presentation/auth/SignIn/v2/SignIn.tsx
  • packages/react/src/components/presentation/auth/SignUp/BaseSignUp.tsx
  • packages/react/src/components/presentation/auth/SignUp/SignUp.tsx
  • packages/react/src/components/presentation/auth/SignUp/v1/BaseSignUp.tsx
  • packages/react/src/components/presentation/auth/SignUp/v1/SignUp.tsx
  • packages/react/src/components/presentation/auth/SignUp/v1/SignUpOptionFactory.tsx
  • packages/react/src/components/presentation/auth/SignUp/v2/BaseSignUp.tsx
  • packages/react/src/components/presentation/auth/SignUp/v2/SignUp.tsx
  • packages/react/src/contexts/ComponentRenderer/ComponentRendererContext.ts
  • packages/react/src/contexts/FlowMeta/FlowMetaProvider.tsx
  • packages/react/src/contexts/Theme/ThemeProvider.tsx
  • packages/react/src/contexts/Theme/v1/ThemeProvider.tsx
  • packages/react/src/contexts/Theme/v2/ThemeProvider.tsx
  • packages/react/src/contexts/ThunderID/ThunderIDContext.ts
  • packages/react/src/contexts/ThunderID/ThunderIDProvider.tsx
  • packages/react/src/hooks/useOAuthCallback.ts
  • packages/react/src/index.ts
  • packages/react/src/utils/buildThemeConfigFromFlowMeta.ts
  • packages/react/src/utils/flowTransformer.ts
  • packages/react/src/utils/getAuthComponentHeadings.ts
  • packages/react/src/utils/passkey.ts
  • packages/react/src/utils/resolveTranslationsInArray.ts
  • packages/react/src/utils/resolveTranslationsInObject.ts
  • packages/vue/src/ThunderIDVueClient.ts
  • packages/vue/src/components/auth/sign-in/AuthOptionFactoryCore.ts
  • packages/vue/src/components/auth/sign-in/BaseSignIn.ts
  • packages/vue/src/components/auth/sign-in/SignIn.ts
  • packages/vue/src/components/auth/sign-in/v1/BaseSignIn.ts
  • packages/vue/src/components/auth/sign-in/v1/SignIn.ts
  • packages/vue/src/components/auth/sign-in/v1/options/SignInOptionFactory.ts
  • packages/vue/src/components/auth/sign-in/v2/AuthOptionFactory.ts
  • packages/vue/src/components/auth/sign-in/v2/BaseSignIn.ts
  • packages/vue/src/components/auth/sign-in/v2/SignIn.ts
  • packages/vue/src/components/auth/sign-up/BaseSignUp.ts
  • packages/vue/src/components/auth/sign-up/SignUp.ts
  • packages/vue/src/components/auth/sign-up/v1/BaseSignUp.ts
  • packages/vue/src/components/auth/sign-up/v1/SignUp.ts
  • packages/vue/src/components/auth/sign-up/v1/options/SignUpOptionFactory.ts
  • packages/vue/src/components/auth/sign-up/v2/BaseSignUp.ts
  • packages/vue/src/components/auth/sign-up/v2/SignUp.ts
  • packages/vue/src/components/presentation/accept-invite/BaseAcceptInvite.ts
  • packages/vue/src/components/presentation/invite-user/BaseInviteUser.ts
  • packages/vue/src/composables/v2/useOAuthCallback.ts
  • packages/vue/src/index.ts
  • packages/vue/src/models/contexts.ts
  • packages/vue/src/providers/FlowMetaProvider.ts
  • packages/vue/src/providers/ThunderIDProvider.ts
  • packages/vue/src/utils/buildThemeConfigFromFlowMeta.ts
  • packages/vue/src/utils/flowTransformer.ts
  • packages/vue/src/utils/getAuthComponentHeadings.ts
  • packages/vue/src/utils/passkey.ts
  • packages/vue/src/utils/resolveTranslationsInArray.ts
  • packages/vue/src/utils/resolveTranslationsInObject.ts
  • pnpm-workspace.yaml
  • tsconfig.base.json

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Remove stale v1/v2 directory branching and promote v2 as default in JavaScript SDKs

1 participant