Skip to content

Warn about legacy context when legacy context is not disabled#30297

Merged
kassens merged 1 commit into
react:mainfrom
kassens:pr30297
Jul 10, 2024
Merged

Warn about legacy context when legacy context is not disabled#30297
kassens merged 1 commit into
react:mainfrom
kassens:pr30297

Conversation

@kassens

@kassens kassens commented Jul 9, 2024

Copy link
Copy Markdown
Contributor

For environments that still have legacy contexts available, this adds a warning to make the remaining call sites easier to locate and encourage upgrades.

@vercel

vercel Bot commented Jul 9, 2024

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 Jul 10, 2024 3:44pm

@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Jul 9, 2024
@kassens kassens force-pushed the pr30297 branch 2 times, most recently from 64eb3f3 to d74094d Compare July 9, 2024 19:27
@kassens kassens requested review from eps1lon and jackpope July 9, 2024 19:32
@kassens kassens force-pushed the pr30297 branch 3 times, most recently from 74fa741 to 59752f7 Compare July 10, 2024 00:27
@kassens

kassens commented Jul 10, 2024

Copy link
Copy Markdown
Contributor Author

Lol, quite a whack-a-mole, but tests pass now. Wish it was easier to see all the tests failing on the last run.

Let me know if that makes sense, ready for review!

name,
);
}
if (ctor.childContextTypes && !didWarnAboutChildContextTypes.has(ctor)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Code copied from line 392-407 above

name,
);
}
if (ctor.childContextTypes && !didWarnAboutChildContextTypes.has(ctor)) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

copied from line 369-384 above

@eps1lon eps1lon left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Link to docs from the error: https://react.dev/blog/2024/04/25/react-19-upgrade-guide#removed-removing-legacy-context?

Though the docs are missing that legacy context was also supported on function Components.

@kassens

kassens commented Jul 10, 2024

Copy link
Copy Markdown
Contributor Author

Though the docs are missing that legacy context was also supported on function Components.

I didn't even know that before seeing the code. Not sure if it was ever broadly communicated as legacy context was deprecated around the time of introduction of function components, IIRC.

For environments that still have legacy contexts available, this adds a warning to make the remaining call sites easier to locate and encourage upgrades.
@kassens kassens merged commit 378b305 into react:main Jul 10, 2024
@kassens kassens deleted the pr30297 branch July 10, 2024 15:53
github-actions Bot pushed a commit that referenced this pull request Jul 10, 2024
For environments that still have legacy contexts available, this adds a
warning to make the remaining call sites easier to locate and encourage
upgrades.

DiffTrain build for commit 378b305.
github-actions Bot pushed a commit that referenced this pull request Jul 10, 2024
For environments that still have legacy contexts available, this adds a
warning to make the remaining call sites easier to locate and encourage
upgrades.

DiffTrain build for [378b305](378b305)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants