Skip to content
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

Expand valid Remix cases for route modules. #6042

Merged
merged 1 commit into from
Jul 9, 2024

Conversation

seanparsons
Copy link
Contributor

Problem:
Sometimes when changing some code the canvas stops rendering in a Remix project.

Cause:
When building the routeModules value, if a file has a default export but it's impossible to find a matching UTOPIA_JSX_COMPONENT then an error occurs in the Remix internals.

Fix:
The getDefaultExportNameAndUidFromFile function is partly responsible for populating routeModules and that has been modified to return an optional UID not just an optional result. This means that routeModules can be populated with an entry for a file that has a default export but that export can't be parsed into a UTOPIA_JSX_COMPONENT.

Commit Details:

  • Change getDefaultExportNameAndUidFromFile to optionally return a uid. Permitting a file that exists with a default export to be included if it doesn't have a UTOPIA_JSX_COMPONENT matching that export.

Manual Tests:
I hereby swear that:

  • I opened a hydrogen project and it loaded
  • I could navigate to various routes in Preview mode

- Change `getDefaultExportNameAndUidFromFile` to optionally return a uid.
  Permitting a file that exists with a default export to be included if
  it doesn't have a `UTOPIA_JSX_COMPONENT` matching that export.
Copy link
Contributor

github-actions bot commented Jul 5, 2024

Try me

Copy link

relativeci bot commented Jul 5, 2024

#13267 Bundle Size — 62.51MiB (~-0.01%).

5cdf95d(current) vs 6339ece master#13264(baseline)

Warning

Bundle contains 51 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Improvement 1 improvement
                 Current
#13267
     Baseline
#13264
Improvement  Initial JS 45.56MiB(~-0.01%) 45.56MiB
No change  Initial CSS 0B 0B
Change  Cache Invalidation 21.62% 21.84%
No change  Chunks 30 30
No change  Assets 33 33
No change  Modules 4323 4323
No change  Duplicate Modules 524 524
No change  Duplicate Code 31.74% 31.74%
No change  Packages 450 450
No change  Duplicate Packages 51 51
Bundle size by type  Change 2 changes Improvement 2 improvements
                 Current
#13267
     Baseline
#13264
Improvement  JS 62.5MiB (~-0.01%) 62.5MiB
Improvement  HTML 11.16KiB (-0.33%) 11.2KiB

Bundle analysis reportBranch fix/slightly-widen-remix-possibi...Project dashboard

@seanparsons seanparsons merged commit 62c3404 into master Jul 9, 2024
17 checks passed
@seanparsons seanparsons deleted the fix/slightly-widen-remix-possibilities branch July 9, 2024 10:10
liady pushed a commit that referenced this pull request Dec 13, 2024
- Change `getDefaultExportNameAndUidFromFile` to optionally return a
uid. Permitting a file that exists with a default export to be included
if it doesn't have a `UTOPIA_JSX_COMPONENT` matching that export.
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.

4 participants