Upgrading an existing Connect app from AUI 7.x to 8.x

Unfortunately, it seems that the jQuery global is still needed (even though the source components appear to include their own vendored copy of jQuery)

AUI still has a dependency on jQuery and, like 6.x and 7.x before it, it treats it as an external dependency. If you’re using Webpack to build your site, you will need to provide jQuery in order for AUI to work. That means you’ll either need to declare jQuery as a dependency of your package and ensure it is compiled in to your own bundle, or you’ll need to declare jQuery as an external dependency and provide it externally to webpack.

It is unclear to me what the most straightforward way of making jQuery available to AUI is. AUI can be consumed three or four discrete ways, which makes shipping it a complicated balancing act between developer ergonomics and runtime costs. As such, I don’t think it makes sense for AUI to provide a bundle of itself that includes a version of jQuery. Counter-arguments are accepted.

When importing an AUI component like messages that doesn’t use any SVGs, in our opinion it should be possible to import only the styles necessary for that component.

Disclaimer: the following advice includes usage of code that may not persist throughout the 8.x series of AUI; treat this as a prototyping experiment to test for viability.

The AUI 8.0 package ships a folder called entry, which includes definitions of entrypoints used by Webpack to create its bundles.

If you were to try one of the following things in your webpacked code:

// accesses an <aui-message> web component element constructor, 
// including CSS for the messages HTML pattern
import { MessageEl } from `@atlassian/aui/entry/aui.component.message`

// pulls in pretty much everything (including CSS, SVG references, etc), but
// is, for the moment, the only way of accessing the 'AJS.messages' variable
import { messages } from `@atlassian/aui/entry/aui.batch.components`

…then you should get access to the CSS + JS necessary for making the message component work.

Hopefully this may improve in AUI@8.1.0 once Atlassian finish gathering requirements for the distribution

I’ve started a separate discussion to push the gathering of requirements forward. AUI 8 discussion: consumption and distribution of AUI