Skip to content

fix bundle-config-loader - #8838

Merged
NathanWalker merged 1 commit into
masterfrom
bundle-entry-points
Sep 10, 2020
Merged

NathanWalker merged 1 commit into
masterfrom
bundle-entry-points

Conversation

@farfromrefug

@farfromrefug farfromrefug commented Sep 9, 2020 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
Contributor

Thank you @farfromrefug !

@NathanWalker
NathanWalker merged commit 1623a56 into master Sep 10, 2020
@NathanWalker
NathanWalker deleted the bundle-entry-points branch September 10, 2020 03:46
@farfromrefug

Copy link
Copy Markdown
Collaborator Author

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

@farfromrefug

Copy link
Copy Markdown
Collaborator Author

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

@farfromrefug

Copy link
Copy Markdown
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
Copy Markdown
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

farfromrefug commented Sep 22, 2020 •

Copy link
Copy Markdown
Collaborator Author

@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.

2 participants