8000 Enable React 19 usage by rm-eth-a-n · Pull Request #7710 · AzureAD/microsoft-authentication-library-for-js · GitHub
[go: up one dir, main page]

Skip to content

Enable React 19 usage #7710

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

Merged
merged 15 commits into from
May 6, 2025
Merged

Conversation

rm-eth-a-n
Copy link
Contributor
@rm-eth-a-n rm-eth-a-n commented Apr 23, 2025

Enable React 19 applications to use this package, it was released on a while back now: https://react.dev/blog/2024/12/05/react-19.

This PR enables applications using react 19 to consume the package, while continuing to allow react 18 applications to continue using this package unhindered.

@rm-eth-a-n

This comment was marked as resolved.

@Ben-CA
Copy link
Ben-CA commented Apr 28, 2025

Hoping this will be pushed out soon. Switched my application to React 19.1, but npm install complains.

image

npm error Could not resolve dependency:
npm error peer react@"^16.8.0 || ^17 || ^18" from @azure/msal-react@3.0.10
npm error node_modules/@azure/msal-react
npm error @azure/msal-react@"^3.0.10" from the root project

@julesblancphin
Copy link
julesblancphin commented Apr 29, 2025

Thanks @rm-eth-a-n for opening this PR, seemed like #7548 was stuck in a draft state forever.

According to one of the maintainers here #7722 (comment), samples need to be updated to ensure E2E tests work as expected and documentation also needs to be updated

It's a shame that it's left to the community to take care of an essential update to a paid microsoft product.

@github-actions github-actions bot added the documentation Related to documentation. label Apr 29, 2025
@rm-eth-a-n

This comment was marked as resolved.

Copy link
Collaborator
@tnorling tnorling left a comment

Choose a reason for hiding this comment

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

Samples should also be updated here as we run E2E tests against these. Thanks!

@rm-eth-a-n

This comment was marked as outdated.

@h3rmanj
Copy link
Contributor
h3rmanj commented May 6, 2025

Samples should also be updated here as we run E2E tests against these. Thanks!

Sadly this is going to be difficult as emotion doesn't support react 19 yet, can we proceed instead of waiting for emotion, as many consumers of msal-react don't use emotion and so could continue happily ?

Are you sure? Both @emotion/react and @emotion/use-insertion-effect-with-fallbacks has a peer dep on "react": ">=16.8.0", which should work with react 19.

@julesblancphin
Copy link

Looks like the emotions team took care of supporting react 19: emotion-js/emotion#3206 @h3rmanj @rm-eth-a-n

@h3rmanj
Copy link
Contributor
h3rmanj commented May 6, 2025

@rm-eth-a-n i created a pull in your repo where I successfully managed to bump samples to react 19. rm-eth-a-n#1

I couldn't run the tests however, as I don't have all values needed to run the samples. But my educated guess based on what react 19 brings, is they'll pass just fine if they run in the automated checks here.

@github-actions github-actions bot added the samples Related to the samples apps for the library. label May 6, 2025
@rm-eth-a-n
Copy link
Contributor Author

use-insertion-effect-with-fallbacks

@h3rmanj I am getting multiple version of react errors in the browser console when running the sample apps, I assume your not getting these ?

@h3rmanj
Copy link
Contributor
h3rmanj commented May 6, 2025

use-insertion-effect-with-fallbacks

@h3rmanj I am getting multiple version of react errors in the browser console when running the sample apps, I assume your not getting these ?

Most likely a case of needing to npm dedupe, and check that all msal projects use react 19. I'll check

@h3rmanj
Copy link
Contributor
h3rmanj commented May 6, 2025

use-insertion-effect-with-fallbacks

@h3rmanj I am getting multiple version of react errors in the browser console when running the sample apps, I assume your not getting these ?

Most likely a case of needing to npm dedupe, and check that all msal projects use react 19. I'll check

Found a react 18 reference in samples/msal-node-samples/ElectronSystemBrowserTestApp and tried to update it. However I'm struggling to run npm dedupe, it just silently crashes. Wonder if the project is just too large

@h3rmanj
Copy link
Contributor
h3rmanj commented May 6, 2025

@rm-eth-a-n got react deduped and samples running in rm-eth-a-n#2

chore: dedupe react packages
@rm-eth-a-n rm-eth-a-n requested a review from a team as a code owner May 6, 2025 13:27
@rm-eth-a-n
Copy link
Contributor Author

@rm-eth-a-n got react deduped and samples running in rm-eth-a-n#2

Awesome thanks @h3rmanj. @tnorling lets us know if there is anything else you need us to do :) ?

@tnorling
Copy link
Collaborator
tnorling commented May 6, 2025

Thanks folks for the engagement on this. Our CI does not run on forks so I'm going to merge this into an internal branch and open a new PR into dev. I will link the new PR here shortly.

@tnorling tnorling changed the base branch from dev to react-19 May 6, 2025 16:30
@tnorling tnorling merged commit c86b6dd into AzureAD:react-19 May 6, 2025
2 checks passed
tnorling added a commit that referenced this pull request May 6, 2025
PR to run CI against #7710 and get it merged into dev. Thanks
@rm-eth-a-n for making the changes

---------

Co-authored-by: rm-eth-a-n <ethan.pearce@right
77F4
move.co.uk>
Co-authored-by: Herman Jensen <herman.jensen@intility.no>
jo-arroyo pushed a commit that referenced this pull request May 19, 2025
PR to run CI against #7710 and get it merged into dev. Thanks
@rm-eth-a-n for making the changes

---------

Co-authored-by: rm-eth-a-n <ethan.pearce@rightmove.co.uk>
Co-authored-by: Herman Jensen <herman.jensen@intility.no>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. msal-react Related to @azure/msal-react samples Related to the samples apps for the library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants
0