-
Notifications
You must be signed in to change notification settings - Fork 86
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
Narrow import of DEFAULT_APP_CATEGORIES
to avoid bundling unnecessary code
#834
Conversation
…ry code Signed-off-by: Miki <miki@amazon.com>
@AMoo-Miki thank you to find out the root cause and have a better solution to fix it, i will close #826. another question is that we have same code in notification plugin, not sure why it works |
@Hailong-am notifications has the same problem of bundling a ton of unnecessary things and this change will help them. The reason the PS, i just noticed that this causes a release build failure and am looking to see how I can solve that.
|
I have a question that why does this only happen in production/bundled mode, not dev mode. Or we can get rid of it earlier. Babel/Webpack stuffs should also be applied when in dev mode. @AMoo-Miki Do you have any idea on this? |
We know different rules are are being applied to prod releases and dev bundles, and are working on narrowing the difference. |
If we change it to public or public/utils, that will be the same change as before. |
Correct; there are multiple factors that have gotten aligned to make this issue manifest here. The good thing is that it has allowed us to discover a couple of problems we have. If one of those factors was removed, we wouldn't have the issue manifest itself and we knew that this PR was not the best solution, even though it eliminated one of the factors to solve the issue, because it was advocating for doing the wrong thing. Over the past couple of days, I have looked at each of the factors and found that the best one is to get rid of your |
@AMoo-Miki do you mean remove babel.config.js and use default? where can i find the default config? |
Description
#741 introduced an import of
DEFAULT_APP_CATEGORIES
which results in the importing of everything under@osd/std
which invokes thetypeof
transformer that confuses babel/webpack/babel plugins/osd-optimizer into incorrectly identifying theexportsArgument
and that results inexports
being used in a context that isn't aware of it, resulting inexport is not defined
when OSD is accessed.I believe this is a better solution than #826 since it prevents the bundling of @osd/std and ... .
Issues Resolved
[List any issues this PR will resolve]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.