-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New msal-browser sample enabling version switching at runtime #7922
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
Conversation
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.
Pull Request Overview
Adds a new Express-based sample for msal-browser
that demonstrates runtime version switching of the MSAL library.
- Introduces a version switcher UI and backing API endpoints in
server.js
- Adds Handlebars views, public JS (including
versionSwitcher.js
), and CSS for the sample - Provides a starter README for running and using the sample
Reviewed Changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
samples/msal-browser-samples/ExpressSample/server.js | New API endpoints and logic for dynamic MSAL versioning |
samples/msal-browser-samples/ExpressSample/public/js/versionSwitcher.js | UI logic for version dropdown, custom version modal |
samples/msal-browser-samples/ExpressSample/public/css/styles.css | Styles for version switcher, modals, and general UI |
samples/msal-browser-samples/ExpressSample/README.md | Initial instructions (missing version switcher docs) |
Comments suppressed due to low confidence (2)
samples/msal-browser-samples/ExpressSample/server.js:184
- Consider adding unit tests for the
/api/version
endpoint (and other versioning endpoints) to verify correct JSON responses and cache behavior under different scenarios.
app.get('/api/version', async (req, res) => {
samples/msal-browser-samples/ExpressSample/README.md:70
- The README doesn't yet document the new version switcher feature. Add a section describing how to use the version dropdown and custom version modal.
- The Profile page will automatically fetch and display your user information from MS Graph.
samples/msal-browser-samples/ExpressSample/public/css/styles.css
Outdated
Show resolved
Hide resolved
Co-authored-by: Copilot <[email protected]>
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.
This is great!
Non-blocking but if you think it's a good idea maybe we can add an alert in the sample UI for when the environment variables haven't been set. I spent like 30 min re-installing and building before I realized that's why it wasn't working for me.
Let me see what I can do. At the very least I'll make sure an .env file is included here to be more obvious, I guess it got ignored by git |
Adds a new sample that includes the ability to switch versions at runtime (both local development builds and any published version). This will be used to test upgrade and downgrade scenarios both manually and in CI.