Closed FroMage closed 2 weeks ago
What about adding it in your deployment module and do the bundling there? That should not influence the user
@phillip-kruger even deployment mvnpm deps are leaking into the user project AFAIK
No that should not ( except in Dev mode)
I went for this solution: https://github.com/quarkiverse/quarkus-renarde/pull/210
Simpler to put in place and no leaking for sure.
No that should not ( except in Dev mode)
I think they are even in normal as web-bundler is also getting compile scope deps
In the final deployable unit? That will defeat the whole purpose of having two modules and should definitely not happen. @aloubyansky ?
OK, so, perhaps the solution is to let me do this in my extension:
@BuildStep
WebBundlerExtensionBundle requireBootstrap() {
return WebBundlerExtensionBundle.bundleFor("renarde-backoffice" /* name of bundle */)
.dependency("org.webjars", "bootstrap", "5.2.3")
.dependency("org.webjars.npm", "bootstrap-icons", "1.10.3")
.build();
}
And without declaring any dependency that leak into the user's CP, the Web Bundler will make a bundle for me, named renarde-backoffice
, made out of these dependencies that I defined. This won't leak into the user's bundles, and the user's bundles won't leak into my extension's bundle.
WDYT?
Sounds good to me.
OK, so, perhaps the solution is to let me do this in my extension:
@BuildStep WebBundlerExtensionBundle requireBootstrap() { return WebBundlerExtensionBundle.bundleFor("renarde-backoffice" /* name of bundle */) .dependency("org.webjars", "bootstrap", "5.2.3") .dependency("org.webjars.npm", "bootstrap-icons", "1.10.3") .build(); }
And without declaring any dependency that leak into the user's CP, the Web Bundler will make a bundle for me, named
renarde-backoffice
, made out of these dependencies that I defined. This won't leak into the user's bundles, and the user's bundles won't leak into my extension's bundle.WDYT?
we don't have a maven resolver in the buildsteps AFAIK
OK, so, perhaps the solution is to let me do this in my extension:
@BuildStep WebBundlerExtensionBundle requireBootstrap() { return WebBundlerExtensionBundle.bundleFor("renarde-backoffice" /* name of bundle */) .dependency("org.webjars", "bootstrap", "5.2.3") .dependency("org.webjars.npm", "bootstrap-icons", "1.10.3") .build(); }
And without declaring any dependency that leak into the user's CP, the Web Bundler will make a bundle for me, named
renarde-backoffice
, made out of these dependencies that I defined. This won't leak into the user's bundles, and the user's bundles won't leak into my extension's bundle. WDYT?we don't have a maven resolver in the buildsteps AFAIK
We don't and we should avoid doing that. In case the dependencies for your extension do not change depending on an app then we could imagine declaring a "named dependency set" that would be pre-resolved and exposed to you during the build somehow.
Basically, you would define this list of dependencies in extension metadata and you would give it a name that you could use to obtain it from some bootstrap API (possibly ApplicationModel.getNamedDependencyModel(name)` or something).
In case the dependencies for your extension do not change depending on an app
They don't change depending on the app, indeed.
This is done
The Renarde Backoffice extension uses Bootstrap, from webjars. I'd prefer for it to use web-bundler, but for that I need to be able to make sure it doesn't pollute end users who might want to not have Bootstrap end up in their bundles.
Perhaps we need a build item for my extension to declare its dependencies on mvnpm modules and get its own "private" bundle that would not be visible from the end user's bundle?