Skip to content

[service-utils] Remove starter_legacy plan type #7276

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

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

jnsdls
Copy link
Member

@jnsdls jnsdls commented Jun 4, 2025

Remove Legacy Plan Types and Fields

This PR removes the following from the codebase:

  • starter_legacy plan type
  • billingPlanVersion field
  • growthTrialEligible field

Additionally, it removes the StarterLegacyDiscontinuedBanner component and all references to the legacy starter plan throughout the dashboard UI.

Summary by CodeRabbit

  • Refactor

    • Removed all references to the "starter_legacy" billing plan across the dashboard and supporting services.
    • Eliminated related fields and mappings, including plan badges, pricing, credits, and storybook entries.
    • Simplified plan display and conditional logic to exclude legacy plan handling.
    • Removed deprecated properties such as billingPlanVersion and growthTrialEligible from team data.
  • Chores

    • Updated mock and stub data to reflect the removal of the legacy plan and unused fields.

Copy link

vercel bot commented Jun 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:55pm
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:55pm
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:55pm
thirdweb-www ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:55pm
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 4, 2025 10:55pm

Copy link

changeset-bot bot commented Jun 4, 2025

🦋 Changeset detected

Latest commit: 1e780d6

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@thirdweb-dev/service-utils Patch

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

Copy link
Contributor

coderabbitai bot commented Jun 4, 2025

Walkthrough

This change removes all references to the starter_legacy billing plan, as well as the billingPlanVersion and growthTrialEligible fields, from both the codebase and type definitions. Associated UI components, mappings, test stubs, and stories referencing these elements are also updated or deleted to reflect their deprecation.

Changes

File(s) Change Summary
packages/service-utils/src/core/api.ts, .../mocks.ts Removed starter_legacy from TeamPlan union; deleted billingPlanVersion and growthTrialEligible from types and mocks.
apps/dashboard/src/@/components/blocks/pricing-card.tsx, .../planToTierRecord.ts Removed starter_legacy from plan-to-SKU/tier mappings and related records.
apps/dashboard/src/app/(app)/components/TeamPlanBadge.tsx, .../PlanInfoCard.tsx Deleted starter_legacy handling from badge and plan display logic.
apps/dashboard/src/app/(app)/team/[team_slug]/layout.tsx Removed StarterLegacyDiscontinuedBanner and its conditional rendering logic.
apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/... Deleted StarterLegacy story and references to starter_legacy in stories.
apps/dashboard/src/components/onboarding/ApplyForOpCreditsModal.tsx Removed starter_legacy from plan-to-credits mapping.
apps/dashboard/src/components/settings/Account/Billing/GatedSwitch.stories.tsx Eliminated starter_legacy from billing plan arrays in stories.
apps/dashboard/src/components/settings/Account/Billing/Pricing.tsx Removed starter_legacy from plan highlighting and tier logic.
apps/dashboard/src/stories/stubs.ts Deleted starter_legacy team/project stubs and removed deprecated fields from stubs.
apps/dashboard/src/utils/pricing.tsx Updated SelectivePlans type exclusion to no longer exclude starter_legacy.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DashboardUI
    participant ServiceUtils

    User->>DashboardUI: Loads billing or team UI
    DashboardUI->>ServiceUtils: Fetch team data (TeamResponse)
    ServiceUtils-->>DashboardUI: Returns team data (without starter_legacy, billingPlanVersion, growthTrialEligible)
    DashboardUI-->>User: Renders UI (no starter_legacy plan, no legacy banners, updated mappings)
Loading

Suggested reviewers

  • joaquim-verges

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a920d1e and 9e45fc1.

📒 Files selected for processing (15)
  • .changeset/many-hounds-wave.md (1 hunks)
  • apps/dashboard/src/@/components/blocks/pricing-card.tsx (0 hunks)
  • apps/dashboard/src/app/(app)/components/TeamPlanBadge.tsx (2 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.stories.tsx (0 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.tsx (1 hunks)
  • apps/dashboard/src/app/(app)/team/[team_slug]/layout.tsx (0 hunks)
  • apps/dashboard/src/app/(app)/team/components/TeamHeader/TeamHeaderUI.stories.tsx (1 hunks)
  • apps/dashboard/src/components/onboarding/ApplyForOpCreditsModal.tsx (1 hunks)
  • apps/dashboard/src/components/settings/Account/Billing/GatedSwitch.stories.tsx (0 hunks)
  • apps/dashboard/src/components/settings/Account/Billing/Pricing.tsx (1 hunks)
  • apps/dashboard/src/components/settings/Account/Billing/planToTierRecord.ts (0 hunks)
  • apps/dashboard/src/stories/stubs.ts (0 hunks)
  • apps/dashboard/src/utils/pricing.tsx (1 hunks)
  • packages/service-utils/src/core/api.ts (0 hunks)
  • packages/service-utils/src/mocks.ts (0 hunks)
💤 Files with no reviewable changes (8)
  • apps/dashboard/src/components/settings/Account/Billing/GatedSwitch.stories.tsx
  • apps/dashboard/src/components/settings/Account/Billing/planToTierRecord.ts
  • packages/service-utils/src/mocks.ts
  • apps/dashboard/src/stories/stubs.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.stories.tsx
  • apps/dashboard/src/@/components/blocks/pricing-card.tsx
  • packages/service-utils/src/core/api.ts
  • apps/dashboard/src/app/(app)/team/[team_slug]/layout.tsx
🧰 Additional context used
🪛 LanguageTool
.changeset/many-hounds-wave.md

[duplication] ~7-~7: Possible typo: you repeated a word.
Context: ...egacyplan type -billingPlanVersionfield -growthTrialEligible` field

(ENGLISH_WORD_REPEAT_RULE)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Size
  • GitHub Check: Lint Packages
  • GitHub Check: Analyze (javascript)
🔇 Additional comments (8)
apps/dashboard/src/app/(app)/team/components/TeamHeader/TeamHeaderUI.stories.tsx (1)

72-79:

✅ Verification successful

Verify complete removal of starterLegacyTeam references.

The conditional validation logic appears correct after removing the starterLegacyTeam check, but ensure all related references (lookup, badge rendering, etc.) have been consistently removed throughout the component.


🏁 Script executed:

#!/bin/bash
# Search for any remaining references to starterLegacyTeam in the file
rg -n "starterLegacyTeam" apps/dashboard/src/app/\(app\)/team/components/TeamHeader/TeamHeaderUI.stories.tsx

Length of output: 108


starterLegacyTeam references removed successfully

All occurrences of starterLegacyTeam have been removed from TeamHeaderUI.stories.tsx – the conditional checks and rendering logic are now clean. No further action needed.

.changeset/many-hounds-wave.md (1)

5-8: Changeset documentation is clear and accurate.

The changeset properly documents the removal of the legacy plan type and related fields. The static analysis hint about word repetition is a false positive - this is standard bullet list formatting.

🧰 Tools
🪛 LanguageTool

[duplication] ~7-~7: Possible typo: you repeated a word.
Context: ...egacyplan type -billingPlanVersionfield -growthTrialEligible` field

(ENGLISH_WORD_REPEAT_RULE)

apps/dashboard/src/app/(app)/components/TeamPlanBadge.tsx (2)

13-17: Badge variant mapping correctly updated.

The removal of starter_legacy from the badge variant mapping is consistent with the plan deprecation.


27-32:

✅ Verification successful

Label function simplified appropriately.

Removing the special case handling for starter_legacy is correct since this plan type is being deprecated.


🏁 Script executed:

#!/bin/bash
# Verify no other references to starter_legacy remain in this file or related badge components
rg -n "starter_legacy" apps/dashboard/src/app/\(app\)/components/TeamPlanBadge.tsx
rg -A 3 -B 3 "starter_legacy" apps/dashboard/src/components/ui/badge.tsx

Length of output: 238


🏁 Script executed:

#!/bin/bash
# Search entire repository for any remaining references to starter_legacy
rg -n "starter_legacy"

Length of output: 22


✅ No remaining starter_legacy references found – approving changes.

A repository-wide search confirms that the deprecated starter_legacy plan case has been fully removed.

apps/dashboard/src/components/onboarding/ApplyForOpCreditsModal.tsx (1)

45-54:

✅ Verification successful

Credits mapping correctly updated.

The removal of starter_legacy from the PlanToCreditsRecord mapping is consistent with the plan deprecation. The TypeScript type system should prevent invalid plan types from being passed to this component.


🏁 Script executed:

#!/bin/bash
# Verify the Team billingPlan type has been updated to exclude starter_legacy
ast-grep --pattern 'type Team = {
  $$$
  billingPlan: $$$
  $$$
}'

# Also check for any remaining starter_legacy references in this file
rg -n "starter_legacy" apps/dashboard/src/components/onboarding/ApplyForOpCreditsModal.tsx

Length of output: 160


I’m not seeing the Team definition or its billingPlan field—let’s locate it to confirm that starter_legacy is truly removed:


🏁 Script executed:

#!/bin/bash
# Find where Team is defined
rg -n "interface Team" .
rg -n "type Team" .

# Inspect all billingPlan occurrences
rg -n "billingPlan" .

Length of output: 13588


Let’s verify the TeamPlan union to ensure starter_legacy has been removed:


🏁 Script executed:

#!/bin/bash
# Extract TeamPlan union definition to check for 'starter_legacy'
rg -n -A5 "type TeamPlan" packages/service-utils/src/core/api.ts

Length of output: 181


Credits mapping and types verified
The starter_legacy plan has been removed from the PlanToCreditsRecord in ApplyForOpCreditsModal.tsx, and we’ve confirmed in packages/service-utils/src/core/api.ts that the TeamPlan union no longer includes "starter_legacy". TypeScript will now statically prevent any invalid billing plans from being passed to this component.

apps/dashboard/src/components/settings/Account/Billing/Pricing.tsx (1)

73-73:

❓ Verification inconclusive

LGTM! Logic simplification aligns with starter_legacy removal.

The simplification of the highlighting logic is consistent with removing the starter_legacy plan type. However, ensure that existing teams with starter_legacy plans are properly handled during the transition period.


🏁 Script executed:

#!/bin/bash
# Verify that starter_legacy plan handling is properly addressed in the codebase
echo "Searching for any remaining starter_legacy references that might cause issues..."

# Search for any remaining starter_legacy references in TypeScript/JavaScript files
rg -A 3 -B 3 "starter_legacy" --type ts --type tsx --type js --type jsx

echo -e "\n=== Checking for any hardcoded starter_legacy strings ==="
rg -A 2 -B 2 '"starter_legacy"' --type ts --type tsx --type js --type jsx

echo -e "\n=== Checking getValidTeamPlan function to ensure it handles starter_legacy gracefully ==="
ast-grep --pattern 'function getValidTeamPlan($$$) { $$$ }'

Length of output: 762


Explanation:

  • We’re dropping file-type filters to catch any remaining references.
  • We’ll search for both string occurrences and the function name.
  • If no hits appear, we can safely conclude there’s no leftover starter_legacy logic.

🏁 Script executed:

#!/bin/bash
set -e

echo "🔍 Searching entire codebase for any 'starter_legacy' references..."
rg -n --fixed-strings "starter_legacy"

echo -e "\n🔍 Searching for all occurrences of getValidTeamPlan..."
rg -n "getValidTeamPlan"

echo -e "\n🔍 Showing context around getValidTeamPlan definitions/usages..."
rg -n "getValidTeamPlan" -C3

Length of output: 198


No stale starter_legacy references detected—removal appears complete

Ran a full-text search for "starter_legacy" and any mentions of getValidTeamPlan across the repository and found no occurrences. The highlighting logic simplification in Pricing.tsx is consistent with fully dropping the legacy plan type.

• Confirm that all migrations or data‐layer fallbacks no longer rely on starter_legacy.
• Double-check any runtime checks or API responses for legacy plan values.

Please verify manually that no runtime paths or data transformations still expect starter_legacy.

apps/dashboard/src/app/(app)/team/[team_slug]/(team)/~/settings/billing/components/PlanInfoCard.tsx (1)

71-71: LGTM! Simplified plan display logic aligns with starter_legacy removal.

The removal of the special case for starter_legacy in the plan name display is consistent with the overall objective of removing legacy starter plan references from the codebase.

apps/dashboard/src/utils/pricing.tsx (1)

3-7:

❌ Incorrect review comment

Verify consistency: starter_legacy inclusion in SelectivePlans may be unintended.

The removal of starter_legacy from the exclusion list means it's now included in SelectivePlans, but the TEAM_PLANS record (lines 20-86) doesn't define a configuration for starter_legacy. This inconsistency could lead to runtime errors if starter_legacy plans still exist in the system.

If starter_legacy is still part of Team["billingPlan"], consider explicitly excluding it:

 type SelectivePlans = Exclude<
   Team["billingPlan"],
   // we will never show cards for these plans - so exclude it
-  "accelerate" | "growth_legacy" | "free"
+  "accelerate" | "growth_legacy" | "free" | "starter_legacy"
 >;

🏁 Script executed:

#!/bin/bash
# Verify if starter_legacy is still part of Team["billingPlan"] type
echo "Checking Team type definition for billingPlan field..."

# Search for Team type definition and billingPlan field
ast-grep --pattern 'type Team = { $$$ billingPlan: $$$; $$$ }'
ast-grep --pattern 'interface Team { $$$ billingPlan: $$$; $$$ }'

echo -e "\n=== Checking for billingPlan type definitions ==="
rg -A 10 -B 2 'billingPlan.*:' --type ts

echo -e "\n=== Checking if starter_legacy is still defined in service-utils ==="
rg -A 5 -B 5 'starter_legacy' packages/service-utils/

Length of output: 7481


To verify whether starter_legacy is still part of the Team["billingPlan"] union (i.e. TeamPlan), let’s inspect the TeamPlan type definition in the service-utils package:


🏁 Script executed:

#!/bin/bash
set -e

echo "=== Locate and display the TeamPlan type definition ==="
rg -n "export type TeamPlan" --type ts packages/service-utils/src/core/api.ts || echo "TeamPlan definition not found"

echo -e "\n=== Context around the TeamPlan definition ==="
rg -A5 -B5 "export type TeamPlan" packages/service-utils/src/core/api.ts || true

Length of output: 469


To determine if starter_legacy is still part of the TeamPlan union, let’s pull in the definition of TeamPlan from the API types:


🏁 Script executed:

#!/bin/bash
set -e

echo "=== Searching for TeamPlan type definition ==="
rg -n "type TeamPlan" -C5 packages/service-utils/src/core/api.ts || echo "No direct match for type TeamPlan"

echo -e "\n=== Showing top of api.ts for context (first 200 lines) ==="
sed -n '1,200p' packages/service-utils/src/core/api.ts

Length of output: 5206


SelectivePlans exclusion is correct—starter_legacy isn’t in TeamPlan.

The TeamPlan union in packages/service-utils/src/core/api.ts does not include "starter_legacy". Therefore, the exclusion list in apps/dashboard/src/utils/pricing.tsx only needs to omit "accelerate" | "growth_legacy" | "free". No changes are required.

Likely an incorrect or invalid review comment.

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Member Author

jnsdls commented Jun 4, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codecov bot commented Jun 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 55.57%. Comparing base (a920d1e) to head (9e45fc1).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7276   +/-   ##
=======================================
  Coverage   55.57%   55.57%           
=======================================
  Files         909      909           
  Lines       58667    58667           
  Branches     4158     4158           
=======================================
  Hits        32606    32606           
  Misses      25954    25954           
  Partials      107      107           
Flag Coverage Δ
packages 55.57% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jnsdls jnsdls force-pushed the _service-utils_Remove_starter_legacy_plan_type branch from 3e21656 to 1e780d6 Compare June 4, 2025 22:44
Copy link
Contributor

github-actions bot commented Jun 4, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 62.57 KB (0%) 1.3 s (0%) 175 ms (+129.07% 🔺) 1.5 s
thirdweb (cjs) 345.38 KB (0%) 7 s (0%) 601 ms (-2.8% 🔽) 7.6 s
thirdweb (minimal + tree-shaking) 5.7 KB (0%) 114 ms (0%) 48 ms (+512.39% 🔺) 162 ms
thirdweb/chains (tree-shaking) 531 B (0%) 11 ms (0%) 13 ms (+750.44% 🔺) 24 ms
thirdweb/react (minimal + tree-shaking) 19.56 KB (0%) 392 ms (0%) 81 ms (+648.74% 🔺) 472 ms

@jnsdls jnsdls merged commit 42236d4 into main Jun 4, 2025
26 checks passed
@jnsdls jnsdls deleted the _service-utils_Remove_starter_legacy_plan_type branch June 4, 2025 23:00
@joaquim-verges joaquim-verges mentioned this pull request Jun 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dashboard Involves changes to the Dashboard. packages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant