Skip to content

Conversation

@imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Nov 3, 2025

Resolves #3987

Lazy loads the 5+ MB language picker bundle piece, so it won't load for most user sessions.


Current "Create Project"

Without LIFT file selected
Screenshot 2025-11-03 115816

With LIFT file selected
Screenshot 2025-11-03 115835


Updated "Create Project"

When no project name is typed and no LIFT file is selected:
Screenshot 2025-11-03 113522

When a project name is typed first:
Screenshot 2025-11-03 114406

When a LIFT file is selected first:
Screenshot 2025-11-03 115030


This change is Reviewable

@codecov
Copy link

codecov bot commented Nov 3, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.60%. Comparing base (675d6d7) to head (ea9f5eb).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3999      +/-   ##
==========================================
+ Coverage   74.57%   74.60%   +0.03%     
==========================================
  Files         291      293       +2     
  Lines       10814    10818       +4     
  Branches     1354     1354              
==========================================
+ Hits         8064     8071       +7     
+ Misses       2358     2352       -6     
- Partials      392      395       +3     
Flag Coverage Δ
backend 85.45% <ø> (ø)
frontend 66.26% <100.00%> (+0.07%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@imnasnainaec
Copy link
Collaborator Author

Bundle before and after:

master

...
dist\whiteText.f65961a3.png                        32 kB    933ms
dist\AppLoggedIn.e0f7bf19.js                 ⚠️  5.23 MB    2.27s
dist\BaseGoalScreen.557fe1bf.js                  4.06 kB    892ms
...

loadable-language-picker

...
dist\whiteText.f65961a3.png                           32 kB    933ms
dist\AppLoggedIn.7c95fca4.js                      220.79 kB    433ms
dist\LanguagePickerWithOptionalT.d0b2d9a6.js       ⚠️  5 MB    949ms
dist\LanguagePickerWithOptionalT.5c368841.js        7.96 kB    484ms
dist\BaseGoalScreen.87c6a03e.js                     4.13 kB    466ms
...

@imnasnainaec imnasnainaec marked this pull request as draft November 3, 2025 16:57
@imnasnainaec imnasnainaec marked this pull request as ready for review November 3, 2025 17:10
@github-actions github-actions bot added the test label Nov 3, 2025
@jasonleenaylor
Copy link
Contributor

src/components/LanguagePicker/LanguagePickerWithOptionalT.tsx line 10 at r1 (raw file):

/** This component wraps LanguagePicker to make the 't' prop optional,
 * providing English strings as the default. */
export default function LanguagePickerWithOptionalT(

How about LoadableLanguagePicker? When we provide translations it will be internal to this method, so the name should reflect the usage.

@jasonleenaylor
Copy link
Contributor

src/components/ProjectScreen/tests/CreateProject.test.tsx line 104 at r1 (raw file):

    // Hides language pickers until project name is typed.
    expect(screen.queryByTestId(mockLangPickerId)).toBeNull();
    await userEvent.type(screen.getByRole("textbox"), "non-empty-name");

Please make a new test for this behavior.

Code quote:

  it("disables language picker(s) when file selected", async () => {
    // Hides language pickers until project name is typed.
    expect(screen.queryByTestId(mockLangPickerId)).toBeNull();
    await userEvent.type(screen.getByRole("textbox"), "non-empty-name");

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

:lgtm:

@jasonleenaylor reviewed 5 of 5 files at r1, 6 of 6 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)

@imnasnainaec imnasnainaec enabled auto-merge (squash) November 3, 2025 21:43
@imnasnainaec imnasnainaec merged commit e9bfa53 into master Nov 3, 2025
19 checks passed
@imnasnainaec imnasnainaec deleted the loadable-language-picker branch November 3, 2025 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

In dev, if email env vars not set, signup throw error

3 participants