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

[BUGFIX lts] ember-template-compiler & fastboot compatibility #18080

Merged
merged 1 commit into from
Jun 7, 2019

Conversation

billybonks
Copy link
Contributor

@billybonks billybonks commented Jun 7, 2019

Problem

When importing ember-template-compiler as part of the dist bundle, it's initializer for DOM Templates
comes along as well.

While this would normally just be extra bytes for no reason when used in conjunction with FastBoot.
It throws a document is undefined error within the bootstrap module.

Patch

If no context is passed to the bootstrap module it throws the aforementioned error, The initializer does check if the current context has a dom but just uses it to set up the context, but a dom instance would not have existed when entering the bootstrap module.

For this, my patch solution would be to only call the bootstrap if a document instance is present.

Moving forward

I would love to get some thoughts on the future of the bootstrap module and this initializer :).

When importing ember-template-compiler as part of the dist bundle, it's initialiser for dom tempaltes
comes along aswell.

While this would just be extra bytes for no reason normally, when used in conjunction with fastboot.
It throws a document is undefined error, within the bootstrap module.
@rwjblue
Copy link
Member

rwjblue commented Jun 7, 2019

Ultimately, we should deprecate this whole bootstrap thing (who even uses this any more !?!?!!?), but this patch looks great to me. Thanks for doing it!

@billybonks
Copy link
Contributor Author

Thanks for the speedy review.

i had the same though, honestly i was surprised to see techniques as old as this still around. is it something we can start now? the way that comes to me would be to put a deprecation warning in it and include have a flag to skip the entire initializer? let me know, if you have a better approach i would enjoy raising a pr to start the process.

@rwjblue rwjblue changed the title [BUGFIX] ember-template-compiler & fastboot compatability [BUGFIX lts] ember-template-compiler & fastboot compatibility Jun 7, 2019
@rwjblue rwjblue merged commit 3579750 into emberjs:master Jun 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants