Skip to content
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

fix bundle-config-loader #8838

Merged
merged 1 commit into from
Sep 10, 2020
Merged

fix bundle-config-loader #8838

merged 1 commit into from
Sep 10, 2020

Conversation

farfromrefug
Copy link
Collaborator

@farfromrefug farfromrefug commented Sep 9, 2020

This PR fixes a big issue which appeared with N 7 / esm / webpack

With webpack import / require order is not respected : webpack/webpack#1343

Now in bundle-config-loader we rely on require to load bundle-entry-points thus calling initGlobals and making tslib functions global.
Because it uses require it actually end up at the end of your main.js (simply look at a generated bundle.js)

To keep that call up we need to use import
But that is not enough!
in bundle-entry-points we use 'require' on 'globals'. And using import is not enough either because we call a method on it which will end up after all imports!

The solution to all this is call initGlobal inside global/index.ts then use import './global' for example.
Doing that i needed cleanup a bit and we end up with only on use of initGlobal

EDIT: that app will crash on ios because of that. The reason is that i import View at the top of my main.ts which include files using __metadata

@cla-bot cla-bot bot added the cla: yes label Sep 9, 2020
NathanWalker
NathanWalker previously approved these changes Sep 10, 2020
@NathanWalker
Copy link
Contributor

Thank you @farfromrefug !

@farfromrefug
Copy link
Collaborator Author

@NathanWalker can you guys test this on your side before we publish this?
Like with real apps

@farfromrefug
Copy link
Collaborator Author

Actually already released:) hope it won't break somewhere:)

@farfromrefug
Copy link
Collaborator Author

@NathanWalker what happened here? That PR seems messed up. DOes not link to my branch anymore master...Akylas:bundle-entry-points

And the issue is still here #8872

@NathanWalker
Copy link
Contributor

The PR you had done here was from a branch on master called bundle-entry-points (wasn't created from your fork):
Screen Shot 2020-09-22 at 8 15 07 AM

@farfromrefug
Copy link
Collaborator Author

farfromrefug commented Sep 22, 2020

@NathanWalker sorry misread ! But wait why is it my description if not my PR? What s going on here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants