diff --git a/docs/v8-migration-api.md b/docs/v8-migration-api.md index d1b721ff58..8703f3f818 100644 --- a/docs/v8-migration-api.md +++ b/docs/v8-migration-api.md @@ -1202,6 +1202,27 @@ Other than the changes listed below, `@babel/parser` is affected by all the [AST + !functionExpressionPath.node.async ``` +- Remove `Scope.prototype.traverse`, `Scope#parentBlock` and `Scope#hub` ([#16705](https://github.com/babel/babel/pull/16705)) + + __Migration__: Use `scope.path` methods and properties instead: + + ```diff + - scope.traverse(scopeRootNode, visitor, state) + + scope.path.traverse(visitor, state) + + - scope.parentBlock + + scope.path.parent + + - scope.hub + + scope.path.hub + ``` + +- Remove `Scope.prototype.getAllBindingsOfKind` and `Scope.prototype.toArray` ([#16705](https://github.com/babel/babel/pull/16705)) + + These methods have been removed as they are not used anymore in our code base. + + __Migration__: You can copy&paste them from Babel 7's source to your plugin. + - Remove `hoist`, `updateSiblingKeys`, `call`, `setScope`, `resync`, `popContext`, `pushContext`, `setup`, `setKey` methods from `NodePath` ([#16655](https://github.com/babel/babel/pull/16655)) These methods are meant to be private so there is no real migration approach. If your plugin / build is broken by this change, feel free to open an issue and tell us how you use these methods and we can see what we can do after Babel 8 is released. @@ -1223,9 +1244,10 @@ Other than the changes listed below, `@babel/parser` is affected by all the [AST __Migration__: If you want to preserve the old behavior, you can use `NodePath#shouldSkip` to check whether a NodePath has been skipped before calling `NodePath#requeue()`. -- Remove `NodePath` methods starting with `_` ([#16504](https://github.com/babel/babel/pull/16504)) +- Remove methods starting with `_` from `Scope` and `NodePath` ([#16504](https://github.com/babel/babel/pull/16504), [#16705](https://github.com/babel/babel/pull/16705)) - ``` + ```js + // NodePath.prototype _assertUnremoved _call _callRemovalHooks @@ -1246,6 +1268,10 @@ Other than the changes listed below, `@babel/parser` is affected by all the [AST _resyncParent _resyncRemoved _verifyNodeList + + // Scope.prototype + _renameFromMap + _generateUid ``` These methods are meant to be private so there is no real migration approach. If your plugin / build is broken by this change, feel free to open an issue and tell us how you use these methods and we can see what we can do after Babel 8 is released. diff --git a/js/minirepl.js b/js/minirepl.js index accb5f0dc1..1ccfad0b97 100644 --- a/js/minirepl.js +++ b/js/minirepl.js @@ -4,10 +4,10 @@ import debounce from "lodash.debounce"; const miniReplExamples = [ "/(?i:a)b/", - `using Flavortown = from(#["Guy Fieri"]);`, + 'using Flavortown = from(#["Guy Fieri"]);', // use next(yourTurn) = throw "some code in here!" // when we support extractors - `let yourTurn = throw "some code in here!"`, + 'let yourTurn = throw "some code in here!"', ]; let inEditor; @@ -15,7 +15,7 @@ let outEditor; let runDemo = true; -const debouncedUpdate = debounce(function() { +const debouncedUpdate = debounce(function () { compileCode(inEditor, outEditor); }, 1000); @@ -61,7 +61,7 @@ function simulateKeys(inEditor, outEditor, texts) { function simulateKey(changingText) { const delay = changingText ? 4000 : Math.round(Math.random() * 125) + 30; - timeout = setTimeout(function() { + timeout = setTimeout(function () { if (!runDemo) { if (timeout) { clearTimeout(timeout); @@ -142,7 +142,7 @@ function compileCode(sourceEditor, targetEditor) { } const BABEL_MINI_REPL = { - start: function() { + start: function () { // don't init editor on mobile devices if (isMobile()) return; @@ -154,7 +154,7 @@ const BABEL_MINI_REPL = { outEditor = setupEditor("hero-repl-out", true); outEditor.renderer.$cursorLayer.element.style.display = "none"; - inEditor.on("change", function() { + inEditor.on("change", function () { if (!inEditor.getValue()) { debouncedUpdate.cancel(); outEditor.setValue(""); @@ -169,13 +169,13 @@ const BABEL_MINI_REPL = { } }); - setTimeout(function() { + setTimeout(function () { document.querySelector(".hero-repl")?.classList.add("hero-repl--visible"); simulateKeys(inEditor, outEditor, miniReplExamples); }, 150); }, - stopDemo: function() { + stopDemo: function () { debouncedUpdate.cancel(); runDemo = false; inEditor.setReadOnly(false);