-
Notifications
You must be signed in to change notification settings - Fork 87
fix(provided-externals): logs warning for child modules #32
fix(provided-externals): logs warning for child modules #32
Conversation
📊 Bundle Size Report
|
☑️ Preflight Checklist: What is the communication plan for this change? Does any documentation need to be updated or added to account for this change? If so was it done already? What is the motivation for this change? Should these changes also be applied to a maintenance branch or any other long lived branch? How was this change tested? Does this change require cross browser checks? Why or why not? Does this change require a performance test prior to merging? Why or why not? Could this be considered a breaking change? Why or why not? Does the change impact caching? Does the change impact HTTP headers? Does the change have any new infrastructure requirements? Does the change affect other versions of the app? Does the change require additional environment variables? What is the impact to tenants? What is the impact to individual users? What is the change to the size of assets? Should integration tests be added to protect against future regressions on this change? |
throw new Error(`Module ${moduleName} attempted to provide externals, but it is not the root module.`); | ||
console.warn( | ||
`Module ${moduleName} attempted to provide externals. Only the root module can provide externals.` | ||
); |
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.
You will need some changes around here: https://github.com/americanexpress/one-app-cli/blob/master/packages/one-app-bundler/webpack/loaders/provided-externals-loader.js#L34
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 think it's best we move that helper added by the loader into One App -> getRootModule
and remove it from being injected. Thoughts?
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.
- Get @10xLaCroixDrinker Feedback on this
66521f5
to
aa0b3a1
Compare
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.
There need to be tests that ensure the dep from the right module is used. Maybe this could be done by providing different externals.
e5ca153
Replaced error thrown
onModuleLoad
with warning log for child modules that contain theprovidedExternals
inappConfig
.