Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/rewire.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Ewald <johannes.ewald@peerigon.com>2018-04-09 21:49:49 +0300
committerJohannes Ewald <johannes.ewald@peerigon.com>2018-04-09 22:00:59 +0300
commit9b77ed9a293c538ec3eb5160bcb933e012ce517f (patch)
tree9b3d93d4cedeeef376d54a412636b7c862229e6a /package.json
parentcbb2802ea5e30b47003298f2756c62ce20b41bb0 (diff)
Replace babel with a regex-based transformation
This regex replacement is not 100% safe because transforming JavaScript requires an actual parser. However, parsing (e.g. via babel) comes with its own problems because now the parser needs to be aware of syntax extensions which might not be supported by the parser, but the underlying JavaScript engine. In fact, rewire used to have babel in place but required an extra transform for the object spread operator (check out commit d9a81c0cdacf6995b24d205b4a2068adbd8b34ff or see https://github.com/jhnns/rewire/pull/128). It was also notable slower (see https://github.com/jhnns/rewire/issues/132). There is another issue: replacing const with let is not safe because of their different behavior. That's why we also have ESLint in place which tries to identify this error case. There is one edge case though: when a new syntax is used *and* a const re-assignment happens, rewire would compile happily in this situation but the actual code wouldn't work. However, since most projects have a seperate linting step which catches these const re-assignment errors anyway, it's probably still a reasonable trade-off. Fixes https://github.com/jhnns/rewire/issues/132
Diffstat (limited to 'package.json')
-rw-r--r--package.json4
1 files changed, 1 insertions, 3 deletions
diff --git a/package.json b/package.json
index 579b88f..436dbf0 100644
--- a/package.json
+++ b/package.json
@@ -40,8 +40,6 @@
"coverage": "istanbul cover ./node_modules/mocha/bin/_mocha"
},
"dependencies": {
- "babel-core": "^6.26.0",
- "babel-plugin-transform-es2015-block-scoping": "^6.26.0",
- "babel-plugin-transform-object-rest-spread": "^6.26.0"
+ "eslint": "^4.19.1"
}
}