Skip to content

Commit

Permalink
Update babel-plugin-ember-modules-api-polyfill to fix issues with inv…
Browse files Browse the repository at this point in the history
…alid identifiers.

The babel plugin previously took an identifier and replaced it's `name` value
with one that included a string like `Ember.Foo`. This is completely
invalid (a string like `Ember.Foo` is actually a MemberExpression), but
we got away with it because for the most part Babel happily printed
**whatever** value you give it in that spot.

Unfortunately, this happy mistake has caused us quite a bit of pain due
to Babel introducing new plugins that run as part of `@babel/preset-env`
(e.g. to make sure that all identifiers would work properly on IE9), and
those plugins **properly** sanitizing invalid identifiers.

The plugin was updated to avoid this mistake, and properly rewrite the
identifiers with a member expression. It also added tests to confirm
things are working as intended.
  • Loading branch information
rwjblue committed May 29, 2020
1 parent 4235f3d commit 1c9b97a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"amd-name-resolver": "^1.2.1",
"babel-plugin-debug-macros": "^0.3.0",
"babel-plugin-ember-data-packages-polyfill": "^0.1.2",
"babel-plugin-ember-modules-api-polyfill": "^2.13.0",
"babel-plugin-ember-modules-api-polyfill": "^2.13.1",
"babel-plugin-module-resolver": "^3.1.1",
"broccoli-babel-transpiler": "^7.4.0",
"broccoli-debug": "^0.6.4",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1574,10 +1574,10 @@ babel-plugin-ember-modules-api-polyfill@^2.12.0, babel-plugin-ember-modules-api-
dependencies:
ember-rfc176-data "^0.3.12"

babel-plugin-ember-modules-api-polyfill@^2.13.0:
version "2.13.0"
resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-2.13.0.tgz#f9d3928d4c40192a44a5b52b67bbdedc4a748ea2"
integrity sha512-Q2i7uZMNSuJFYUV8stEsLQIRfMhQJew62sOnR+ESNjb4vlI7Rj1JlSgymTGwmCTVh+poTBpMidiWCoITDtbiIA==
babel-plugin-ember-modules-api-polyfill@^2.13.1:
version "2.13.1"
resolved "https://registry.yarnpkg.com/babel-plugin-ember-modules-api-polyfill/-/babel-plugin-ember-modules-api-polyfill-2.13.1.tgz#a529ec260ee2c5af5b5696074b23334535100368"
integrity sha512-h9DZ4wD7LYfKK98bZ7Rf6EX7bi5bmfO/hS/jWdqFj4OrpBa4qwRUczBDU7tUlyLcOxyXvXa6+DzXk38I65Y7vA==
dependencies:
ember-rfc176-data "^0.3.13"

Expand Down

0 comments on commit 1c9b97a

Please sign in to comment.