-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Disable the modules API polyfill on Ember 3.27+ #683
Conversation
2c27d0f
to
4d205a4
Compare
Disables the modules API polyfill on the latest versions of Ember.
bfafe95
to
45bdb10
Compare
|
Yeah, this PR is going to be dependent on
The first one is a fix that directly impacts the behavior of this addon, the second one is required in order to properly test this addon with the intended behavior |
Disables the modules API polyfill on the latest versions of Ember.
45bdb10
to
26d9fdc
Compare
Rebased to pull in the babel-plugin-htmlbars-inline-precompile updates . |
…:ember-cli/ember-cli-htmlbars into disable-modules-api-polyfill-with-latest
3871565
to
fadc36c
Compare
lib/template-compiler-plugin.js
Outdated
@@ -24,7 +24,7 @@ function rethrowBuildError(error) { | |||
} | |||
|
|||
class TemplateCompiler extends Filter { | |||
constructor(inputTree, _options) { | |||
constructor(inputTree, _options, requiresModuleApiPolyfill) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably default to true
here. Otherwise, this is a breaking change.
lib/colocated-babel-plugin.js
Outdated
state._colocationEnsureImport = (exportName, moduleName) => { | ||
let addedImports = (allAddedImports[moduleName] = allAddedImports[moduleName] || {}); | ||
|
||
if (addedImports[exportName]) return addedImports[exportName]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this suffer from the same problem that ember-cli/babel-plugin-htmlbars-inline-precompile#357 fixed?
Shouldn't this return a new identifier each time?
lib/colocated-babel-plugin.js
Outdated
path.unshiftContainer('body', newImport); | ||
} | ||
|
||
return addedImports[exportName]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this suffer from the same problem that ember-cli/babel-plugin-htmlbars-inline-precompile#357 fixed?
}) | ||
); | ||
|
||
it('invokes AST plugins', async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for using async/await here, I just haven't had a chance to clean these other co.wrap's up yet
assert.strictEqual(outputString, expected); | ||
assert.ok(outputString.includes('Huzzah!')); | ||
}); | ||
let tree = new TemplateCompiler(input.path(), htmlbarsOptions, true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW, adding true
here is the thing I was referring to (as a breaking change). If you do require('ember-cli-htmlbars')
the thing you get is the template compiler broccoli-plugin (for better or worse) which makes the constructor at least intimate API (but probably public).
fadc36c
to
3697751
Compare
@@ -169,6 +170,9 @@ module.exports = { | |||
|
|||
let isProduction = process.env.EMBER_ENV === 'production'; | |||
|
|||
let checker = new VersionChecker(this.parent).for('ember-source', 'npm'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suspect this is broken in second-level or deeper addons. They're looking for ember-source in their parent only, but should be looking at the top level project. Same kind of bug as emberjs/ember-cli-babel#396
Disables the modules API polyfill on the latest versions of Ember.