From 2724f4f8342761e244017661b907fd21f74d8f00 Mon Sep 17 00:00:00 2001 From: Richard Button Date: Mon, 1 Aug 2022 10:14:55 -0400 Subject: [PATCH] update playground build config Signed-off-by: Richard Button --- package.json | 4 ++-- .../record-tuple-playground/src/index.jsx | 2 +- .../src/runner/index.js | 3 ++- rollup.config.js | 4 ---- webpack.config.js | 13 +++++++++++- yarn.lock | 20 +++++++++---------- 6 files changed, 27 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 86231f0..d2ff245 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,8 @@ "jest": "^24.9.0", "jest-diff": "^24.9.0", "lerna": "^3.18.3", - "monaco-editor": "^0.20.0", - "monaco-editor-webpack-plugin": "^1.9.0", + "monaco-editor": "^0.33.0", + "monaco-editor-webpack-plugin": "^7.0.1", "path": "^0.12.7", "prettier": "^1.19.1", "process": "^0.11.10", diff --git a/packages/record-tuple-playground/src/index.jsx b/packages/record-tuple-playground/src/index.jsx index 4107b5d..b45865b 100644 --- a/packages/record-tuple-playground/src/index.jsx +++ b/packages/record-tuple-playground/src/index.jsx @@ -313,7 +313,7 @@ class App extends React.Component { this.iframe = document.createElement("iframe"); this.iframe.src = "./runner/index.html"; this.iframe.onload = () => - this.iframe.contentWindow.run(this.state.output, this.fakeConsole); + this.iframe.contentWindow.run(this.state.output, this.fakeConsole, globalThis.console); this.iframeContainerRef.current?.appendChild(this.iframe); } else { this.iframe.contentWindow.location.reload(); diff --git a/packages/record-tuple-playground/src/runner/index.js b/packages/record-tuple-playground/src/runner/index.js index 8f83b70..03d1b8b 100644 --- a/packages/record-tuple-playground/src/runner/index.js +++ b/packages/record-tuple-playground/src/runner/index.js @@ -8,7 +8,7 @@ const NO_NATIVE_WEAKREF_ERROR = "We enabled a shim that will leak memory that reproduces those features.\n\n" + "To enable these experimental features natively, go to:\n https://github.com/bloomberg/record-tuple-polyfill#playground"; -globalThis.run = function(source, console) { +globalThis.run = function(source, console, parentConsole) { globalThis.console = console; if (POLYFILLED_WEAKREF) { @@ -21,5 +21,6 @@ globalThis.run = function(source, console) { return import(/*webpackIgnore: true*/ dataUri).catch(e => { console.error(e.message); console.error(e); + parentConsole.error(e); }); }; diff --git a/rollup.config.js b/rollup.config.js index 34b47c5..ada5939 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -13,8 +13,6 @@ ** See the License for the specific language governing permissions and ** limitations under the License. */ -import babel from "rollup-plugin-babel"; - function pkg(name, path) { if (path) { return `packages/${name}/${path}`; @@ -37,7 +35,6 @@ const POLYFILL_CONFIG = [ name: "RecordAndTuple", }, ], - plugins: [babel()], }, { input: pkg(PKG_NAME, "src/modify-global.js"), @@ -52,7 +49,6 @@ const POLYFILL_CONFIG = [ name: "RecordAndTuple", }, ], - plugins: [babel()], }, ]; diff --git a/webpack.config.js b/webpack.config.js index df4c447..aa1ba05 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -35,7 +35,18 @@ module.exports = { use: { loader: "babel-loader", options: { - presets: ["@babel/preset-env", "@babel/preset-react"], + targets: "defaults", + presets: [ + [ + "@babel/preset-env", + { + exclude: [ + "@babel/plugin-transform-new-target", + ], + }, + ], + "@babel/preset-react", + ], }, }, }, diff --git a/yarn.lock b/yarn.lock index 442d6fb..cbe4f22 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6248,7 +6248,7 @@ loader-utils@^1.2.3: emojis-list "^3.0.0" json5 "^1.0.1" -loader-utils@^2.0.0: +loader-utils@^2.0.0, loader-utils@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129" integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A== @@ -6668,22 +6668,22 @@ monaco-editor-core@^0.19.0: resolved "https://registry.yarnpkg.com/monaco-editor-core/-/monaco-editor-core-0.19.3.tgz#6d2b36f42f0f42be6def5604810fafc288c9cc3e" integrity sha512-Fd6bTTaAxDAulh3q9Hordj80DSFZFGhjKX/Z3K/kElA9xkPyNwyaOjphYp8254nhUEKCk56TKP7qfRkUjjZF3w== -monaco-editor-webpack-plugin@^1.9.0: - version "1.9.1" - resolved "https://registry.yarnpkg.com/monaco-editor-webpack-plugin/-/monaco-editor-webpack-plugin-1.9.1.tgz#eb4bbb1c5e5bfb554541c1ae1542e74c2a9f43fd" - integrity sha512-x7fx1w3i/uwZERIgztHAAK3VQMsL8+ku0lFXXbO81hKDg8IieACqjGEa2mqEueg0c/fX+wd0oI+75wB19KJAsA== +monaco-editor-webpack-plugin@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/monaco-editor-webpack-plugin/-/monaco-editor-webpack-plugin-7.0.1.tgz#ba19c60aba990184e36ad8722b1ed6a564527c7c" + integrity sha512-M8qIqizltrPlIbrb73cZdTWfU9sIsUVFvAZkL3KGjAHmVWEJ0hZKa/uad14JuOckc0GwnCaoGHvMoYtJjVyCzw== dependencies: - loader-utils "^1.2.3" + loader-utils "^2.0.2" monaco-editor@^0.19.0: version "0.19.3" resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.19.3.tgz#1c994b3186c00650dbcd034d5370d46bf56c0663" integrity sha512-2n1vJBVQF2Hhi7+r1mMeYsmlf18hjVb6E0v5SoMZyb4aeOmYPKun+CE3gYpiNA1KEvtSdaDHFBqH9d7Wd9vREg== -monaco-editor@^0.20.0: - version "0.20.0" - resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.20.0.tgz#5d5009343a550124426cb4d965a4d27a348b4dea" - integrity sha512-hkvf4EtPJRMQlPC3UbMoRs0vTAFAYdzFQ+gpMb8A+9znae1c43q8Mab9iVsgTcg/4PNiLGGn3SlDIa8uvK1FIQ== +monaco-editor@^0.33.0: + version "0.33.0" + resolved "https://registry.yarnpkg.com/monaco-editor/-/monaco-editor-0.33.0.tgz#842e244f3750a2482f8a29c676b5684e75ff34af" + integrity sha512-VcRWPSLIUEgQJQIE0pVT8FcGBIgFoxz7jtqctE+IiCxWugD0DwgyQBcZBhdSrdMC84eumoqMZsGl2GTreOzwqw== move-concurrently@^1.0.1: version "1.0.1"