GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [compiler] Implement support for hoisted and recursive functions by mvitousek · Pull Request #30922 · react/react

Conversation

@mvitousek

@mvitousek mvitousek commented Sep 9, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

  • -> [compiler] Implement support for hoisted and recursive functions #30922

Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mvitousek
[compiler] Implement support for hoisted and recursive functions
6508bf7
Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

[ghstack-poisoned]
@vercel

vercel Bot commented Sep 9, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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

Name Status Preview Comments Updated (UTC)
react-compiler-playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 16, 2024 6:10pm
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@mvitousek mvitousek mentioned this pull request Sep 9, 2024
[compiler] Fixture to show current behavior of nested function declarations #30921
Closed
mvitousek added a commit that referenced this pull request Sep 9, 2024
@mvitousek
[compiler] Implement support for hoisted and recursive functions
74aa17f
Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

ghstack-source-id: 7ebf5ea
Pull Request resolved: #30922
@facebook-github-bot facebook-github-bot added the CLA Signed label Sep 9, 2024
@vercel
vercel Bot deployed to Preview September 9, 2024 01:05
View deployment
josephsavona
josephsavona reviewed Sep 9, 2024
View reviewed changes
Comment thread compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts
Comment on lines +1004 to +1017
case InstructionKind.HoistedFunction:
CompilerError.invariant(false, {
reason: 'Unexpected HoistedFunction variable in for..in collection',
description: null,
loc: iterableItem.loc,
suggestions: null,
});
case InstructionKind.Function:
CompilerError.invariant(false, {
reason: 'Unexpected Function variable in for..in collection',
description: null,
loc: iterableItem.loc,
suggestions: null,
});

@josephsavona josephsavona Sep 9, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

we could just collapse all these unsupported cases

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
josephsavona
josephsavona reviewed Sep 9, 2024
View reviewed changes
Comment thread compiler/packages/babel-plugin-react-compiler/src/ReactiveScopes/CodegenReactiveFunction.ts
Comment on lines +1120 to +1133
case InstructionKind.HoistedFunction:
CompilerError.invariant(false, {
reason: 'Unexpected HoistedFunction variable in for..of collection',
description: null,
loc: iterableItem.loc,
suggestions: null,
});
case InstructionKind.Function:
CompilerError.invariant(false, {
reason: 'Unexpected Function variable in for..of collection',
description: null,
loc: iterableItem.loc,
suggestions: null,
});

@josephsavona josephsavona Sep 9, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

same here

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
josephsavona
josephsavona approved these changes Sep 9, 2024
View reviewed changes

@josephsavona josephsavona left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

wow awesome!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@mvitousek
Update on "[compiler] Implement support for hoisted and recursive fun…
b308f2f
…ctions"

Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

[ghstack-poisoned]
mvitousek added a commit that referenced this pull request Sep 9, 2024
@mvitousek
[compiler] Implement support for hoisted and recursive functions
7ed187e
Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

ghstack-source-id: 597e547
Pull Request resolved: #30922
@vercel
vercel Bot deployed to Preview September 9, 2024 17:29
View deployment
@mvitousek
Update on "[compiler] Implement support for hoisted and recursive fun…
ad41acf
…ctions"

Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

[ghstack-poisoned]
mvitousek added a commit that referenced this pull request Sep 16, 2024
@mvitousek
[compiler] Implement support for hoisted and recursive functions
892a2e4
Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

ghstack-source-id: fa40d49
Pull Request resolved: #30922
@vercel
vercel Bot deployed to Preview September 16, 2024 18:10
View deployment
@mvitousek
mvitousek merged commit ad41acf into gh/mvitousek/32/base Sep 16, 2024
mvitousek added a commit that referenced this pull request Sep 16, 2024
@mvitousek
[compiler] Implement support for hoisted and recursive functions
d7167c3
Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

ghstack-source-id: fa40d49
Pull Request resolved: #30922
@mvitousek
mvitousek deleted the gh/mvitousek/32/head branch September 16, 2024 18:13
github-actions Bot pushed a commit that referenced this pull request Sep 16, 2024
@mvitousek
[compiler] Implement support for hoisted and recursive functions
f5d6218
Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

ghstack-source-id: fa40d49
Pull Request resolved: #30922

DiffTrain build for [d7167c3](d7167c3)
@vercel-release-bot vercel-release-bot mentioned this pull request Sep 17, 2024
Upgrade React from 206df66e-20240912 to a99d8e8d-20240916 vercel/next.js#70190
Merged
eps1lon pushed a commit to vercel/next.js that referenced this pull request Sep 18, 2024
@vercel-release-bot
Upgrade React from 206df66e-20240912 to a99d8e8d-20240916 (#70190)
5791706
**breaking change for canary users: Bumps peer dependency of React from
`19.0.0-rc-206df66e-20240912` to `19.0.0-rc-a99d8e8d-20240916`**

[diff
react/react@206df66e...a99d8e8d](react/react@206df66...a99d8e8)

<details>
<summary>React upstream changes</summary>

- react/react#30977
- react/react#30971
- react/react#30922
- react/react#30917
- react/react#30902
- react/react#30912
- react/react#30970
- react/react#30969
- react/react#30967
- react/react#30966
- react/react#30960
- react/react#30968
- react/react#30961
- react/react#28255
- react/react#30957
- react/react#30958
- react/react#30959
- react/react#30951
- react/react#30954
- react/react#30920
- react/react#30942

</details>
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@mvitousek
[compiler] Implement support for hoisted and recursive functions
c870504
Summary:
Introduces a new binding kind for functions that allows them to be hoisted. Also has the result of causing all nested function declarations to be outputted as function declarations, not as let bindings.

ghstack-source-id: fa40d49
Pull Request resolved: react#30922

This branch was successfully deployed

1 active deployment
Preview — ad41acfa Deployed Sep 16, 2024 by vercel[bot]
View deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@josephsavona josephsavona josephsavona approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@mvitousek @josephsavona @facebook-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.