Skip to content

[Master] Split BrowserModalComponent out of GUI#2993

Closed
rschamp wants to merge 3 commits intomasterfrom
hotfix/fix-browser-modal
Closed

[Master] Split BrowserModalComponent out of GUI#2993
rschamp wants to merge 3 commits intomasterfrom
hotfix/fix-browser-modal

Conversation

@rschamp
Copy link
Contributor

@rschamp rschamp commented Aug 27, 2018

I know this is pretty ugly, but I think what we want to avoid crashing unsupported browsers. Available for QA here: https://llk.github.io/scratch-gui/hotfix/fix-browser-modal/

Resolves

What Github issue does this resolve (please include link)?
Resolves failing smoke test in #2980 (already merged). Should future-proof us from this type of regression in the future (Hello from the past future us! Sorry!)

Proposed Changes

Describe what this Pull Request does
This splits the BrowserModalComponent out of the GUI, and protects all GUI-related modules from being imported unless the GUI is actually being mounted. This protects unsupported browsers from running code that will crash them (like the VM).

Reason for Changes

Explain why these changes should be made
If the VM is ever instantiated, which happens whenever GUI is instantiated due to default props, then IE11 will crash. So mount the BrowserModalComponent in a separate code path from the GUI, so that it can be displayed regardless of the code required by the GUI.

Test Coverage

Please show how you have added tests to cover your changes
Failing smoke test now passes!

Browser Coverage

Check the OS/browser combinations tested (At least 2)

Mac

  • Chrome
  • Firefox
  • Safari

Windows

  • IE 11
  • Chrome
  • Firefox
  • Edge

Chromebook

  • Chrome

iPad

  • Safari

Android Tablet

  • Chrome

@rschamp
Copy link
Contributor Author

rschamp commented Aug 27, 2018

Try it out: hotfix/fix-browser-modal

I'm a bot, not actually @rschamp!

@BryceLTaylor
Copy link
Contributor

@chrisgarrity Now it's up to you!

Copy link
Contributor

@chrisgarrity chrisgarrity left a comment

Choose a reason for hiding this comment

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

A couple of nitpicky details that would be good to clean up. Otherwise it's ugly, but does the trick.

>
{previewInfoVisible ? (
<PreviewModal hideIntro={hideIntro} />
{(previewInfoVisible && !hideIntro) ? (

This comment was marked as abuse.

* @returns {React.Component} component with redux and intl state provided
*/
const AppStateHOC = function (WrappedComponent) {
const AppStateHOC = function (WrappedComponent, localesOnly) {

This comment was marked as abuse.

@chrisgarrity
Copy link
Contributor

By the way I also verified the unsupported browser on Opera (OSX)

If the VM is ever instantiated, which happens whenever GUI is instantiated due to default props, then IE11 will crash
@rschamp rschamp force-pushed the hotfix/fix-browser-modal branch from 884e419 to 58b2b76 Compare September 5, 2018 15:44
Ray Schamp added 2 commits September 5, 2018 11:52
Removing this was the point of moving the test up one level. Thanks @chrisgarrity, good catch!
@rschamp rschamp deleted the hotfix/fix-browser-modal branch September 7, 2018 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants