The distribution build changed shape in AUI 8 – where there used to be mutliple files like aui.js, aui-experimental.js – AUI 8 ships with just one "all-in" bundle.
This is not ideal for page weight, nor for CDN. However, it does make the "where does this component live" story simpler.
We should decide if there's a reasonable default shape of AUI that would be both smaller than an "all-in" bundle, and if so, what the set of files a developer needs to pull in would be to get their components.
This would then inform how we both:
Update the webpack build(s) for the distribution, and
Update documentation for component pages to tell them which file(s) to pull in (maybe... or we go the bootstrap style of keeping all that on a separate page)
Developers, developers, developers, developers!
If you stumble upon this issue because you're hoping AUI will get updated to make it easier for you to consume, leave a comment! The AUI team need data and context to understand how people want to be consuming it. Without knowing what you want, it's hard for the team to build something you want
There's also a discussion on the developer ecosystem, including a few polls for data on how you're making use of AUI: https://community.developer.atlassian.com/t/aui-8-discussion-consumption-and-distribution-of-aui/25941
Currently, when you develop a JavaScipt plugin and core code, you either have to specify a single dependency `@atlassian/aui` in your `package.json` file if you have a modern project or you skip that, hoping that AJS namespace will be available during the runtime.
It would be perfect if we could leverage the power of the Webpack WRM plugin and be able to import explicit dependencies of AUI components or helper, then autogenerate the WRM dependencies.
For example, let's say you would like to start using dropdown2 component. Right now you don't need to import `@atlassian/aui`NPM package into your code. What you have to do instead is to specify the WRM dependency on `com.atlassian.auiplugin:aui-dropdown2 and in an older version of AUI you only had to depend on the main package `com.atlassian.auiplugin:ajs`.
If we decide to ship multiple entities in a single NPM package for each of the components, then we could require to specify explicit dependencies like, e.g. `@atlassian/aui/dropdown2`. Maybe even ship multiple small NPM packages a then depend on it and import `@atlassian/aui-dropdown2` NPM package.
At this point, if we know what our explicit dependencies are, then the Webpack WRM plugin during the bundle time could produce the XML configuration provide the matching dependency `com.atlassian.auiplugin:aui-dropdown2`, and skip from bundling the NPM package into production bundle.
It looks like a lot of changes in a way we work with AUI, but I reckon the biggest pros of this solution is that we have the explicit dependencies. At the same time, the WRM provides only the required parts of AUI for runtime instead of putting the whole library into the browser.
I might be totally overengineering this solution as well and we don't need to do that at all.