-
Notifications
You must be signed in to change notification settings - Fork 524
Turn on Web lab 2 Preview v2 by default #70071
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
|
Converting to draft while I resolve an issue with starter images on the new preview |
fisher-alice
left a comment
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.
Exciting! Just left a non-blocking suggestion about adding a dcdo flag.
| document.addEventListener('DOMContentLoaded', () => { | ||
| ReactDOM.render( | ||
| useWeblab2PreviewV2 ? <InnerHTMLPreview2 /> : <InnerHTMLPreview />, | ||
| useLegacyPreview ? <InnerHTMLPreview /> : <InnerHTMLPreview2 />, |
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.
Maybe this is being overly cautious, but what do you think of adding a dcdo flag in case there's an issue found that impacts all users?
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.
I think given it's a pilot and we have tested it on prod already with multiple machines I don't think we need a dcdo flag.
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.
Sounds good!
| // to enable the fixed prefix locally. | ||
| // Use the flag ?weblab2-full-urls=true or ?enableExperiments=weblab2-full-urls | ||
| // to use the true channel id based url on localhost (this makes it so having multiple tabs with different projects | ||
| // open at the same time works correctly). |
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.
Nice option!
This updates Web Lab 2 to use the service worker based preview by default. See #69422 and #69557 for details on the previous work to get this set up.
Using this new preview will make running Web Lab 2 locally a little more complex. The reason for this is due to how service workers expect localhost to be set up; namely, not how we do it 😄 Because our localhost isn't viewed as "secure" for service workers, we have to break glass a bit. The easiest way to do this is on Chrome. You can set a flag with
chrome://flags/#unsafely-treat-insecure-origin-as-secure(search that in chrome to load the flag settings). I would recommend setting this flag to the following so you can run on either port:By default on localhost we use a fixed prefix for the preview url because otherwise you would need to add an exception for every channel id you test. If you want to use the channel id based prefix, use the flag
?weblab2-full-urls=trueor?enableExperiments=weblab2-full-urls(only works on localhost, otherwise we always use the full url).Another side effect of this issue is drone tests that rely on the preview won't work, because drone runs a "localhost" version of the app. Therefore I've split the web lab 2 UI test into a preview test and a general test, so on drone we at least have a general "it renders" test. The preview test will run on test only now.
I kept the legacy preview available under the flag
weblab2-legacy-previewfor now, in case there an unexpected issues for users. The only major issue I could see happening is a school firewall blocking the service worker, which could take time to unblock.Links
Testing story
Tested locally with these changes, and on prod with the previous experiment flag enabled.
Follow up work
After this has been out for a few days and we don't see issues with users, we can remove the legacy flag and the old code. Then I will rename
InnerHTMLPreview2toInnerHTMLPreview. I'll also see if there's any logic inHTMLPreviewwe can get rid of once we are on one preview.PR Creation Checklist: