Skip to content

update playground build config #97

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion packages/record-tuple-playground/src/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
3 changes: 2 additions & 1 deletion packages/record-tuple-playground/src/runner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
});
};
4 changes: 0 additions & 4 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
Expand All @@ -37,7 +35,6 @@ const POLYFILL_CONFIG = [
name: "RecordAndTuple",
},
],
plugins: [babel()],
},
{
input: pkg(PKG_NAME, "src/modify-global.js"),
Expand All @@ -52,7 +49,6 @@ const POLYFILL_CONFIG = [
name: "RecordAndTuple",
},
],
plugins: [babel()],
},
];

Expand Down
13 changes: 12 additions & 1 deletion webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
},
},
},
Expand Down
20 changes: 10 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down Expand Up @@ -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"
Expand Down