-
Notifications
You must be signed in to change notification settings - Fork 137
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
[WIP] [Fix #862] add emberSourceRealModules flag #866
Conversation
6f992e3
to
8d11d3c
Compare
d219a5a
to
2d1e7d9
Compare
2959625
to
308b097
Compare
@@ -415,6 +416,17 @@ export class AppBuilder<TreeNames> { | |||
{ absoluteRuntime: __dirname, useESModules: true, regenerator: false }, | |||
]); | |||
|
|||
{ |
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.
needs cleanup
@@ -1480,3 +1492,58 @@ function combinePackageJSON(...layers: object[]) { | |||
} | |||
return mergeWith({}, ...layers, custom); | |||
} | |||
|
|||
function macroBabelPlugins() { |
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.
needs comment
// This flag provideds adventurous ember-source users & addon-authors the | ||
// ability to test & begin preperation prior to this feature becomeing the | ||
// default. | ||
emberSourceRealModules?: boolean | null; |
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.
we likely no longer need null
here
Test failures so far are just the expected deprecation warning. @rwjblue based on our chat, it would seem like we should allow those deprecations…. Although that does annoy me a little…. |
I think if we use modules-api-polyfill it's going to cause deprecation spew on Ember 3.27+? When code in a true ES module handled by webpack does: import Component from '@ember/component'` modules-api-polyfill will rewrite that to We could instead configure webpack's externals so that it knows to defer these imports to runtime and access them via runtime |
That approach sounds better. I'll give it whirl |
@ef4 It sounds like we may want to essentially add the data from https://github.com/ember-cli/ember-rfc176-data to webpack |
@stefanpenner yes, but please try to use it via https://github.com/embroider-build/embroider/blob/7bab34a265e234ab45e8eaf40482f8dbce7aa5cc/packages/shared-internals/src/ember-standard-modules.ts which exists for this purpose. |
@stefanpenner I realized we probably already have enough support for externalizing ember dependencies in adjust-imports-plugin. You may want to just try not doing anything to externalize the ember modules because this code probably already gets it right: embroider/packages/core/src/babel-plugin-adjust-imports.ts Lines 274 to 301 in 7bab34a
|
If memory serves this fails (I dont have the exact failure handy), but I will begin investigation in about 1 -> 1.5h. |
I will resume this and now that #881 has landed, I bet some of the issues will be resolved. |
356efcd
to
c785d94
Compare
rebased (will continue to investigate as time permits) |
bb807f1
to
995d02a
Compare
55b4a1e
to
5a87c89
Compare
quick rebase again |
dc7e5d7
to
b8ce0ed
Compare
@@ -141,6 +141,11 @@ class RewriteManifest extends Plugin { | |||
extraVendorFiles, | |||
}; | |||
|
|||
json['ember-addon'] = { |
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 don't remember if this was actually important now, i think it isn't and should likely be removed
c9b7344
to
3aa84c8
Compare
8a3a299
to
2590547
Compare
@@ -4,6 +4,7 @@ let rules: PackageRules[] = [ | |||
{ | |||
package: '@ember-data/store', | |||
addonModules: { | |||
//'-private/index.js': { |
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.
do i need this? I don't even remember.
d6ccc3a
to
867a385
Compare
[ | ||
require.resolve('babel-plugin-ember-modules-api-polyfill'), | ||
{ ignore }, | ||
'@embroider/core:babel-plugin-ember-modules-api-polyfill', | ||
], | ||
[ | ||
require.resolve('babel-plugin-debug-macros'), | ||
{ | ||
flags: [ | ||
{ | ||
source: '@glimmer/env', | ||
flags: { DEBUG: isDebug, CI: !!process.env.CI }, | ||
}, | ||
], | ||
|
||
externalizeHelpers: { | ||
global: 'Ember', | ||
}, | ||
|
||
debugTools: { | ||
isDebug, | ||
source: '@ember/debug', | ||
assertPredicateIndex: 1, | ||
}, | ||
}, | ||
'@embroider/core:@ember/debug stripping', | ||
], |
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.
Now that i re-enabled this block, I remember why I disabled it.
This block makes tests pass, but trips up against the globals warnings. Removing it makes some tests fail, especially when add-ons import
things like @glimmer/tracking
. There are several approaches we can take to address this, I hope to sync up with @ef4 tomorrow to discuss options.
* changes “real module” mode of ember-source to begin automatically at 4.0.0, rather then 3.27.0-beta.0 * adds emberSourceRealModules option, to opt into this mode prior to 4.0.0 * begins fixing [email protected] issues * replicate ember-cli-babel’s non-“Real module” mode when the emberSourceRealModules is false
752c627
to
9ef5980
Compare
Closing in favor of #978 |
(I think @ef4 meant to close this with his comment above) |
TODO: