From afb60351bff821827a95b01af04336027adfe6fd Mon Sep 17 00:00:00 2001 From: Sven SAULEAU Date: Thu, 26 Jan 2017 19:22:16 +0100 Subject: [PATCH] docs: remove link to REPL --- packages/babel-plugin-check-es2015-constants/README.md | 1 - .../babel-plugin-syntax-trailing-function-commas/README.md | 1 - .../babel-plugin-transform-class-constructor-call/README.md | 2 -- packages/babel-plugin-transform-class-properties/README.md | 1 - packages/babel-plugin-transform-do-expressions/README.md | 2 -- .../babel-plugin-transform-exponentiation-operator/README.md | 1 - packages/babel-plugin-transform-export-extensions/README.md | 1 - packages/babel-plugin-transform-function-bind/README.md | 3 --- packages/babel-plugin-transform-object-rest-spread/README.md | 1 - 9 files changed, 13 deletions(-) diff --git a/packages/babel-plugin-check-es2015-constants/README.md b/packages/babel-plugin-check-es2015-constants/README.md index 608891b3d235..1ee65e3f073a 100644 --- a/packages/babel-plugin-check-es2015-constants/README.md +++ b/packages/babel-plugin-check-es2015-constants/README.md @@ -20,7 +20,6 @@ repl: "a" is read-only | ^ ``` -[Try in REPL](http://babeljs.io/repl/#?babili=false&evaluate=true&lineWrap=false&presets=es2015&experimental=false&loose=false&spec=false&code=const%20a%20%3D%201%3B%0Aa%20%3D%202%3B&playground=true) ## Installation diff --git a/packages/babel-plugin-syntax-trailing-function-commas/README.md b/packages/babel-plugin-syntax-trailing-function-commas/README.md index fd7022b23fdf..61622bfe69e3 100644 --- a/packages/babel-plugin-syntax-trailing-function-commas/README.md +++ b/packages/babel-plugin-syntax-trailing-function-commas/README.md @@ -14,7 +14,6 @@ clownPuppiesEverywhere( 'bar', ); ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=function%20clownPuppiesEverywhere(%0A%20%20param1%2C%0A%20%20param2%2C%0A)%20%7B%20%2F*%20...%20*%2F%20%7D%0A%0AclownPuppiesEverywhere(%0A%20%20'foo'%2C%0A%20%20'bar'%2C%0A)%3B) ## Example diff --git a/packages/babel-plugin-transform-class-constructor-call/README.md b/packages/babel-plugin-transform-class-constructor-call/README.md index badb23aef9b8..519c27cc71fd 100644 --- a/packages/babel-plugin-transform-class-constructor-call/README.md +++ b/packages/babel-plugin-transform-class-constructor-call/README.md @@ -23,7 +23,6 @@ class Point { let p1 = new Point(1, 2); // OK let p2 = Point(3, 4); // OK ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=class%20Point%20%7B%0A%0A%20%20constructor(x%2C%20y)%20%7B%0A%20%20%20%20this.x%20%3D%20x%3B%0A%20%20%20%20this.y%20%3D%20y%3B%0A%20%20%7D%0A%0A%20%20call%20constructor(x%2C%20y)%20%7B%0A%20%20%20%20return%20new%20Point(x%2C%20y)%3B%0A%20%20%7D%0A%0A%7D%0A%0Alet%20p1%20%3D%20new%20Point(1%2C%202)%3B%20%2F%2F%20OK%0Alet%20p2%20%3D%20Point(3%2C%204)%3B%20%2F%2F%20OK) ## Example @@ -60,7 +59,6 @@ class Date { let now = new Date(); // Get a Date instance let nowStr = Date(); // Use the 'call constructor()' part to get a string value of the current date ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=class%20Date%20%7B%0A%20%20constructor()%20%7B%0A%20%20%20%20%2F%2F%20...%0A%20%20%7D%0A%0A%20%20call%20constructor()%20%7B%0A%20%20%20%20let%20date%20%3D%20new%20Date()%3B%0A%20%20%20%20return%20date.toString()%3B%0A%20%20%7D%0A%7D%0A%0Alet%20now%20%3D%20new%20Date()%3B%20%2F%2F%20Get%20a%20Date%20instance%0Alet%20nowStr%20%3D%20Date()%3B%20%2F%2F%20Use%20the%20'call%20constructor()'%20part%20to%20get%20a%20string%20value%20of%20the%20current%20date) ## Installation diff --git a/packages/babel-plugin-transform-class-properties/README.md b/packages/babel-plugin-transform-class-properties/README.md index 9dbe559082f0..df28bcab6d39 100644 --- a/packages/babel-plugin-transform-class-properties/README.md +++ b/packages/babel-plugin-transform-class-properties/README.md @@ -33,7 +33,6 @@ Below is a class with four class properties which will be transformed. console.log(Bork.staticFunction()); // > "babelIsCool" ``` -[Try in REPL](http://babeljs.io/repl/#?babili=false&evaluate=false&lineWrap=false&presets=es2016%2Clatest%2Cstage-2&code=%20%20class%20Bork%20%7B%0A%20%20%20%20%2F%2FProperty%20initilizer%20syntax%0A%20%20%20%20instanceProperty%20%3D%20%22bork%22%3B%0A%20%20%20%20boundFunction%20%3D%20()%20%3D%3E%20%7B%0A%20%20%20%20%20%20return%20this.instanceProperty%3B%0A%20%20%20%20%7D%0A%20%20%20%20%0A%20%20%20%20%2F%2FStatic%20class%20properties%0A%20%20%20%20static%20staticProperty%20%3D%20%22babeliscool%22%3B%0A%20%20%20%20static%20staticFunction%20%3D%20function()%20%7B%0A%20%20%20%20%20%20return%20Bork.staticProperty%3B%0A%20%20%20%20%7D%0A%20%20%7D%0A%0A%20%20let%20myBork%20%3D%20new%20Bork%3B%0A%0A%20%20%2F%2FProperty%20initializers%20are%20not%20on%20the%20prototype.%0A%20%20console.log(Bork.prototype.boundFunction)%3B%20%2F%2F%20%3E%20undefined%0A%0A%20%20%2F%2FBound%20functions%20are%20bound%20to%20the%20class%20instance.%0A%20%20console.log(myBork.boundFunction.call(undefined))%3B%20%2F%2F%20%3E%20%22bork%22%0A%0A%20%20%2F%2FStatic%20function%20exists%20on%20the%20class.%0A%20%20console.log(Bork.staticFunction())%3B%20%2F%2F%20%3E%20%22babelIsCool%22) ## Installation diff --git a/packages/babel-plugin-transform-do-expressions/README.md b/packages/babel-plugin-transform-do-expressions/README.md index 93cb41255856..3408d8d8948d 100644 --- a/packages/babel-plugin-transform-do-expressions/README.md +++ b/packages/babel-plugin-transform-do-expressions/README.md @@ -22,7 +22,6 @@ let a = do { let a = x > 10 ? 'big' : 'small'; ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=%0Alet%20x%20%3D%20100%3B%0A%0Alet%20a%20%3D%20do%20%7B%0A%20%20if(x%20%3E%2010)%20%7B%0A%20%20%20%20'big'%3B%0A%20%20%7D%20else%20%7B%0A%20%20%20%20'small'%3B%0A%20%20%7D%0A%7D%3B%0A%0Aconsole.log(a)%3B) This example is not the best usage because it is too simple and using a ternary operator is a better option but you can have a much more complex condition in the `do { ... }` expression with several `if ... else` chains: @@ -80,7 +79,6 @@ const Component = props => ; ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Creact%2Cstage-0&code=const%20Component%20%3D%20props%20%3D%3E%0A%20%20%3Cdiv%20className%3D'myComponent'%3E%0A%20%20%20%20%7Bdo%20%7B%0A%20%20%20%20%20%20if(color%20%3D%3D%3D%20'blue')%20%7B%20%3CBlueComponent%2F%3E%3B%20%7D%0A%20%20%20%20%20%20if(color%20%3D%3D%3D%20'red')%20%7B%20%3CRedComponent%2F%3E%3B%20%7D%0A%20%20%20%20%20%20if(color%20%3D%3D%3D%20'green')%20%7B%20%3CGreenComponent%2F%3E%3B%20%7D%0A%20%20%20%20%7D%7D%0A%20%20%3C%2Fdiv%3E%0A%3B) ## Installation diff --git a/packages/babel-plugin-transform-exponentiation-operator/README.md b/packages/babel-plugin-transform-exponentiation-operator/README.md index 82769d80a36a..274dfe84162e 100644 --- a/packages/babel-plugin-transform-exponentiation-operator/README.md +++ b/packages/babel-plugin-transform-exponentiation-operator/README.md @@ -24,7 +24,6 @@ let b = 3; b **= 3; // same as: b = b * b * b; ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=%2F%2F%20x%20**%20y%0A%0Alet%20squared%20%3D%202%20**%202%3B%0A%2F%2F%20same%20as%3A%202%20*%202%0A%0Alet%20cubed%20%3D%202%20**%203%3B%0A%2F%2F%20same%20as%3A%202%20*%202%20*%202%0A%0A%0A%2F%2F%20x%20**%3D%20y%0A%0Alet%20a%20%3D%202%3B%0Aa%20**%3D%202%3B%0A%2F%2F%20same%20as%3A%20a%20%3D%20a%20*%20a%3B%0A%0Alet%20b%20%3D%203%3B%0Ab%20**%3D%203%3B%0A%2F%2F%20same%20as%3A%20b%20%3D%20b%20*%20b%20*%20b%3B) ## Installation diff --git a/packages/babel-plugin-transform-export-extensions/README.md b/packages/babel-plugin-transform-export-extensions/README.md index 26f7d5127824..6014dc4c53f1 100644 --- a/packages/babel-plugin-transform-export-extensions/README.md +++ b/packages/babel-plugin-transform-export-extensions/README.md @@ -8,7 +8,6 @@ export * as ns from 'mod'; export v from 'mod'; ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=export%20*%20as%20ns%20from%20'mod'%3B%0Aexport%20v%20from%20'mod'%3B) ## Installation diff --git a/packages/babel-plugin-transform-function-bind/README.md b/packages/babel-plugin-transform-function-bind/README.md index 0de28102947f..76505a17f4ad 100644 --- a/packages/babel-plugin-transform-function-bind/README.md +++ b/packages/babel-plugin-transform-function-bind/README.md @@ -18,7 +18,6 @@ func.call(obj, val) func.call(obj, val) ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=obj%3A%3Afunc%3B%0A%0Aobj%3A%3Afunc(val)%3B%0A%0A%3A%3Aobj.func(val)%3B) ## Example @@ -43,7 +42,6 @@ function add(val) { return this + val; } console.log(bigBox::getWeight()::add(5)); // prints '15' ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=const%20box%20%3D%20%7B%0A%20%20weight%3A%202%2C%0A%20%20getWeight()%20%7B%20return%20this.weight%3B%20%7D%2C%0A%7D%3B%0A%0Aconst%20%7B%20getWeight%20%7D%20%3D%20box%3B%0A%0Aconsole.log(box.getWeight())%3B%20%2F%2F%20prints%20'2'%0A%0Aconst%20bigBox%20%3D%20%7B%20weight%3A%2010%20%7D%3B%0Aconsole.log(bigBox%3A%3AgetWeight())%3B%20%2F%2F%20prints%20'10'%0A%2F%2F%20bigBox%3A%3AgetWeight()%20is%20equivalent%20to%20getWeight.call(bigBox)%0A%0A%2F%2F%20Can%20be%20chained%3A%0Afunction%20add(val)%20%7B%20return%20this%20%2B%20val%3B%20%7D%0A%0Aconsole.log(bigBox%3A%3AgetWeight()%3A%3Aadd(5))%3B%20%2F%2F%20prints%20'15') ### Using with `document.querySelectorAll` @@ -59,7 +57,6 @@ let sslUrls = document.querySelectorAll('a') console.log(sslUrls); ``` -[Try in REPL](http://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=%0Aconst%20%7B%20map%2C%20filter%20%7D%20%3D%20Array.prototype%3B%0A%0Alet%20sslUrls%20%3D%20document.querySelectorAll('a')%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%3Amap(node%20%3D%3E%20node.href)%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%3A%3Afilter(href%20%3D%3E%20href.substring(0%2C%205)%20%3D%3D%3D%20'https')%3B%0A%0Aconsole.log(sslUrls)%3B%0A) `document.querySelectorAll` returns a `NodeList` element which is not a plain array, so you normally can't use the `map` function on it, and have to use it this way: `Array.prototype.map.call(document.querySelectorAll(...), node => { ... })`. The above code using the `::` will work because it is equivalent to: diff --git a/packages/babel-plugin-transform-object-rest-spread/README.md b/packages/babel-plugin-transform-object-rest-spread/README.md index 7fd2afe5305d..b8f365d7afe8 100644 --- a/packages/babel-plugin-transform-object-rest-spread/README.md +++ b/packages/babel-plugin-transform-object-rest-spread/README.md @@ -16,7 +16,6 @@ let n = { x, y, ...z }; console.log(n); // { x: 1, y: 2, a: 3, b: 4 } ``` -[Try in REPL](https://babeljs.io/repl/#?evaluate=true&presets=es2015%2Cstage-0&code=%2F%2F%20Rest%20properties%0Alet%20%7B%20x%2C%20y%2C%20...z%20%7D%20%3D%20%7B%20x%3A%201%2C%20y%3A%202%2C%20a%3A%203%2C%20b%3A%204%20%7D%3B%0Aconsole.log(x)%3B%20%2F%2F%201%0Aconsole.log(y)%3B%20%2F%2F%202%0Aconsole.log(z)%3B%20%2F%2F%20%7B%20a%3A%203%2C%20b%3A%204%20%7D%0A%0A%2F%2F%20Spread%20properties%0Alet%20n%20%3D%20%7B%20x%2C%20y%2C%20...z%20%7D%3B%0Aconsole.log(n)%3B%20%2F%2F%20%7B%20x%3A%201%2C%20y%3A%202%2C%20a%3A%203%2C%20b%3A%204%20%7D) ## Installation