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

Where to put insertEmberWormholeElementToDom in an addon? #1923

Open
paddor opened this issue Apr 28, 2023 · 3 comments
Open

Where to put insertEmberWormholeElementToDom in an addon? #1923

paddor opened this issue Apr 28, 2023 · 3 comments

Comments

@paddor
Copy link

paddor commented Apr 28, 2023

Our addon uses ember-bootstrap but the element #ember-bootstrap-wormhole is not automatically added to the DOM in the app that uses this addon. The configs (such as insertEmberWormholeElementToDom = true) in the addon's ember-cli-build.js file don't apply to the app AFAIK. So where to put these configs in case of an addon?


Output from ember bootstrap:info (in the addon):

Npm packages:
ember-bootstrap: ^6.0.0-2 -> 6.0.0-2
ember-cli: ~4.8.0 -> 4.8.0
bootstrap: ^5.2.3 -> 5.2.3
bootstrap-sass: n/a
ember-cli-sass: ^11.0.1 -> 11.0.1
ember-cli-less: n/a
Bower packages:
bootstrap: n/a
bootstrap-sass: n/a
ember-bootstrap configuration:
bootstrapVersion: 5
importBootstrapCSS: false
insertEmberWormholeElementToDom: true
@arohr
Copy link
Contributor

arohr commented May 7, 2023

It works if ember-bootstrap is added as a dependency of the ember-app. But I does not work if ember-bootstrap is a dependency of an ember-addon which in turn is consumed by the ember-app.

It looks like the contentFor() hook is only called in the first case.

contentFor(type, config) {

@arohr
Copy link
Contributor

arohr commented May 7, 2023

Maybe related to ember-cli/ember-cli#8077 ?

@jelhan
Copy link
Contributor

jelhan commented Dec 21, 2023

Not sure if this is something we can or should solve in Ember Bootstrap. It seems to be a design decision to not run contentFor hook of indirect v1 dependencies. v2 addons does not have a contentFor hook as far as I know. We likely need to change how the wormhole target gets into the index.html anyways when migrating to a v2 addon. See #1980 (comment) for details.

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

No branches or pull requests

3 participants