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

RSC: Fix babel-plugin-redwood-cell to work wiht more than one cell #9994

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

Tobbe
Copy link
Member

@Tobbe Tobbe commented Feb 12, 2024

When building for RSC we actually build it three times

  1. Analyze the source code to find 'use client' and 'use server'
  2. Build for the client
  3. Build for the server

In the last step, where we build for the server, babel (for some unknown reason) parses over the files multiple times and keeps plugins in memory. And because it keeps plugins in memory plugin-scoped variables keep their values between different files. This caused a problem for us when transforming cells, so now I clear those variables as soon as we enter a new file.

@Tobbe Tobbe added the release:fix This PR is a fix label Feb 12, 2024
@Tobbe Tobbe added this to the RSC milestone Feb 12, 2024
@Tobbe Tobbe merged commit 7ee21cd into redwoodjs:main Feb 12, 2024
40 of 44 checks passed
@Tobbe Tobbe deleted the tobbe-rsc-babel-plugin-redwood-cell-fix branch February 12, 2024 17:04
@Josh-Walker-GM Josh-Walker-GM modified the milestones: RSC, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release:fix This PR is a fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants