From 0fb35e5cfb3e70dc01432dfe1d0c68d0df7e77ce Mon Sep 17 00:00:00 2001 From: Thomas Weber Date: Sun, 2 Aug 2020 17:07:52 -0500 Subject: [PATCH] Check that scratch-render and scratch-vm are using the right versions --- src/playground/editor.jsx | 3 +-- src/playground/player.jsx | 3 +-- src/playground/tw-imports.js | 4 ++++ src/playground/tw-self-check/index.js | 17 +++++++++++++++++ 4 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 src/playground/tw-imports.js create mode 100644 src/playground/tw-self-check/index.js diff --git a/src/playground/editor.jsx b/src/playground/editor.jsx index 6f74f6bdc..2dace8360 100644 --- a/src/playground/editor.jsx +++ b/src/playground/editor.jsx @@ -1,5 +1,4 @@ -// must be first for progress bar to work -import './tw-hacky-progress-bar'; +import './tw-imports'; import ReactDOM from 'react-dom'; import React from 'react'; diff --git a/src/playground/player.jsx b/src/playground/player.jsx index ec72ca7c7..a211b33e0 100644 --- a/src/playground/player.jsx +++ b/src/playground/player.jsx @@ -1,5 +1,4 @@ -// must be first for progress bar to work -import './tw-hacky-progress-bar'; +import './tw-imports'; import ReactDOM from 'react-dom'; import React from 'react'; diff --git a/src/playground/tw-imports.js b/src/playground/tw-imports.js new file mode 100644 index 000000000..609e4dfb8 --- /dev/null +++ b/src/playground/tw-imports.js @@ -0,0 +1,4 @@ +// this should be the first file imported by all entry points +// the order of these imports does matter +import './tw-hacky-progress-bar/index.js'; +import './tw-self-check/index.js'; diff --git a/src/playground/tw-self-check/index.js b/src/playground/tw-self-check/index.js new file mode 100644 index 000000000..d5477977c --- /dev/null +++ b/src/playground/tw-self-check/index.js @@ -0,0 +1,17 @@ +// Check our dependencies to make sure we are using the TurboWarp versions forks. +// This is a development tool -- users should never see these messages. + +/* eslint-disable */ + +import VirtualMachine from 'scratch-vm'; +import RenderWebGL from 'scratch-render'; + +if (!VirtualMachine.isTurboWarp) { + alert('The installed scratch-vm is not the TurboWarp fork.'); + console.error('The installed scratch-vm is not the TurboWarp fork.'); +} + +if (!RenderWebGL.isTurboWarp) { + alert('The installed scratch-render is not the TurboWarp fork.'); + console.error('The installed scratch-render is not the TurboWarp fork.'); +}