Skip to content

refactor: move billing frontend to billing repo#3577

Draft
dkrizan wants to merge 15 commits intomainfrom
dkrizan/split-billing-frontend
Draft

refactor: move billing frontend to billing repo#3577
dkrizan wants to merge 15 commits intomainfrom
dkrizan/split-billing-frontend

Conversation

@dkrizan
Copy link
Copy Markdown
Contributor

@dkrizan dkrizan commented Mar 30, 2026

Summary

  • Move all billing frontend code (~120+ components) from webapp/src/ee/billing/ to the billing repo's frontend/ directory
  • Platform references billing code via Vite path aliases, mirroring how the billing backend is already included
  • Introduce billingModule.tsx entry point so new billing features don't require platform changes
  • Split tsconfig into tsconfig.vite.json (for Vite, no npm package paths) and tsconfig.extend.json (for tsc)
  • Everything is conditional — platform works without the billing repo (OSS mode)

Depends on

  • tolgee/billing PR with matching dkrizan/split-billing-frontend branch

Test plan

  • npm run tsc passes
  • npm run eslint passes
  • npm run build produces valid bundle
  • Vite dev server loads UI correctly
  • Billing routes work (subscriptions, invoices, admin plans)
  • OSS build works without billing repo

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 926c4d9f-85e3-49b0-97ad-87b82a9c5f12

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
  • Commit unit tests in branch dkrizan/split-billing-frontend

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 and usage tips.

@dkrizan dkrizan force-pushed the dkrizan/split-billing-frontend branch 3 times, most recently from 41ddc9f to 7bc97f9 Compare April 1, 2026 15:13
dkrizan and others added 14 commits April 2, 2026 20:23
Move all billing frontend code from webapp/src/ee/billing/ to the
billing repo's frontend/ directory. Platform now references billing
code via path aliases and Vite config, mirroring the backend pattern.

Key changes:
- Add tsconfig.vite.json for Vite-only path resolution (no npm paths)
- Update vite.config.ts with conditional billing aliases and fs.allow
- Refactor eeModule.ee.tsx to use billingModule entry point
- Move billingApiSchema.generated.ts to billing repo
- Update dataCy.plugin to generate separate billing dataCyType.d.ts
- Update eslint script to cover billing frontend code

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
This test uses billing-specific data-cy values and belongs in billing
e2e. Also updates billingApiSchema stub with permissive types and
commits dataCyType.d.ts without billing values (CI-compatible).
Move translation of billing admin menu labels from eeModule to
billingModule.useAdministrationMenuItems() hook so translation keys
are extractable from the billing repo.
The committed version must match what CI generates (without billing).
Billing e2e regenerates it before typecheck.
Platform's generate-data-cy.mjs and Vite plugin only scan src/ —
no billing dependency. Billing e2e has its own generate script that
combines platform + billing values before typechecking.
Switch can't see through Fragment children in React Router v5.
Since routes.Administration is rendered outside a Switch by its
consumer, Fragment works correctly.
Restores shared billing UI components (Plan, ActiveSubscription),
billingApiSchema stub, tsconfig fallback paths, and tg.billing alias
that were lost during rebase on main. Also updates dataCyType.d.ts.
Billing code from outside webapp/ gets duplicate package instances
in production builds. Adding react-router-dom, formik, react-query,
yup, clsx to resolve.dedupe ensures single instances. Also uses
separate Switch blocks for platform and billing admin routes.
Change dataCyType.d.ts format from union type to interface-based
pattern (DataCy.Values). TypeScript merges interface declarations
across files, so each repo generates only its own values and they
combine automatically. No more regeneration conflicts.
…s test

Move limitPopover/, CriticalUsageCircle, TrialChip, TrialAnnouncement,
BillingProgress, and other UI components that are only consumed by
platform back to ee/billing/. Extract getHighlightColor to shared
planUtils.ts. Move selfHostedLimits.cy.ts back to platform e2e.
GlobalLimitPopover, CriticalUsageCircle, TrialAnnouncement, TrialChip
are platform components — import them directly instead of routing
through billingModule.
@dkrizan dkrizan force-pushed the dkrizan/split-billing-frontend branch from a160cbd to f888cea Compare April 2, 2026 18:23
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.

1 participant