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

chore(ssr): remove unique var generator #4970

Merged
merged 2 commits into from
Nov 27, 2024
Merged

Conversation

wjhsf
Copy link
Contributor

@wjhsf wjhsf commented Nov 27, 2024

Details

The SSR compiler generates repeated patterns that often share the same scope (e.g. property access), but the implementations require the use of variables. In the initial version of the compiler, we used a shared global state to generate sequential variable names (i.e. a, b, c, ...). However, more recently we have switched to using block statements (e.g. { const value = 'string'; ... }) to create new scopes and avoid variable collision. With #4963 merged, we no longer use the unique variable generator, so this PR removes it.

Does this pull request introduce a breaking change?

  • 😮‍💨 No, it does not introduce a breaking change.

Does this pull request introduce an observable change?

  • 🤞 No, it does not introduce an observable change.

GUS work item

We've moved to a pattern of using block statements for more descriptive variable names. The `getUniqueVar` helper is no longer used anywhere.
@wjhsf wjhsf requested a review from a team as a code owner November 27, 2024 16:20
@nolanlawson nolanlawson merged commit 195d404 into master Nov 27, 2024
11 checks passed
@nolanlawson nolanlawson deleted the wjh/no-unique-vars branch November 27, 2024 17:13
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.

2 participants