david
(David Taylor)
December 2, 2022, 1:05pm
5
I’ve had a look into what caused this change in behaviour. The connectors were located like this:
assets/javascripts/discourse/templates/user/connectors/{outlet-name}/{unique-name}.js
assets/javascripts/discourse/templates/user/connectors/{outlet-name}/{unique-name}.hbs
That extra /user/ in the path means that it isn’t detected by our 'unColocateConnectors` logic
const COLOCATED_CONNECTOR_REGEX =
/^(?<prefix>.*)\/connectors\/(?<outlet>[^\/]+)\/(?<name>[^\/\.]+)\.(?<extension>.+)$/;
// Having connector templates and js in the same directory causes a clash
// when outputting es6 modules. This shim separates colocated connectors
// into separate js / template locations.
function unColocateConnectors(tree) {
return new Funnel(tree, {
getDestinationPath: function (relativePath) {
const match = relativePath.match(COLOCATED_CONNECTOR_REGEX);
if (
match &&
match.groups.extension === "hbs" &&
match.groups.prefix.split("/").pop() !== "templates"
) {
const { prefix, outlet, name } = match.groups;
return `${prefix}/templates/connectors/${outlet}/${name}.hbs`;
}
if (
match &&
This file has been truncated. show original
I had a search through all-the-plugins and all-the-themes and I don’t see any other occurrences of this directory layout. So I’m going to leave things as-is for now, unless we get more reports of issues.