Skip to content

Commit

Permalink
Remove extension autoLoad functionality (rancher#8700)
Browse files Browse the repository at this point in the history
  • Loading branch information
nwmac authored Apr 28, 2023
1 parent a62df64 commit c628c5a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 56 deletions.
1 change: 0 additions & 1 deletion shell/creators/app/files/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ const config = require('@rancher/shell/vue.config');
module.exports = config(__dirname, {
excludes: [],
// excludes: ['fleet', 'example']
// autoLoad: ['fleet', 'example']
});
22 changes: 0 additions & 22 deletions shell/plugins/dashboard-store/extensions.js

This file was deleted.

14 changes: 0 additions & 14 deletions shell/plugins/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,9 @@
import { allHashSettled } from '@shell/utils/promise';
import { shouldNotLoadPlugin, UI_PLUGIN_BASE_URL } from '@shell/config/uiplugins';

const META_NAME_PREFIX = 'app-autoload-';

export default async function(context) {
// UI Plugins declared in the HTML head
const meta = context.app?.head?.meta || [];
const hash = {};

meta.forEach((m) => {
const metaName = m.name || '';

if (metaName.indexOf(META_NAME_PREFIX) === 0) {
const name = metaName.substr(META_NAME_PREFIX.length);

hash[name] = context.$plugin.loadAsync(name, m.content);
}
});

// Provide a mechanism to load the UI without the plugins loaded - in case there is a problem
let loadPlugins = true;

Expand Down
18 changes: 0 additions & 18 deletions shell/vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,32 +87,14 @@ module.exports = function(dir, _appConfig) {

const appConfig = _appConfig || {};
const excludes = appConfig.excludes || [];
const autoLoad = appConfig.autoLoad || [];

const serverMiddleware = [];
const autoLoadPackages = [];
const watcherIgnores = [
/.shell/,
/dist-pkg/,
/scripts\/standalone/
];

autoLoad.forEach((pkg) => {
// Need the version number of each file
const pkgPackageFile = require(path.join(dir, 'pkg', pkg, 'package.json'));
const pkgRef = `${ pkg }-${ pkgPackageFile.version }`;

autoLoadPackages.push({
name: `app-autoload-${ pkgRef }`,
content: `/pkg/${ pkgRef }/${ pkgRef }.umd.min.js`
});

// Anything auto-loaded should also be excluded
if (!excludes.includes(pkg)) {
excludes.push(pkg);
}
});

// Find any UI packages in node_modules
const NM = path.join(dir, 'node_modules');
const pkg = require(path.join(dir, 'package.json'));
Expand Down
1 change: 0 additions & 1 deletion vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ const excludes = process.env.EXCLUDES_PKG || defaultExcludes;
module.exports = config(__dirname, {
excludes: excludes.replace(/\s/g, '').split(','),
// excludes: ['fleet', 'example']
// autoLoad: ['fleet', 'example']
});

0 comments on commit c628c5a

Please sign in to comment.