Remove the window.AppBoot function #98543
Open
+14
−26
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'm often running into the dreadful "
window.AppBoot
is not a function error" so I started looking into it.This PR is the result: let's remove the
window.AppBoot
function and replace it with amain
/boot
function that is called directly in the JS code. That's how webpack apps are supposed to be done. Webpack will make sure that the chunks are loaded in the last one, and that the root module which callsmain()
is run only when all other modules are loaded.I'm not sure about two things:
home
orreader
). These chunks are loaded after the entrypoint. But the scripts will be executed only aftermain()
was already called, because that call is in the entrypoint chunk. Before this PR, we postponed themain
call until all chunks were loaded.