mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 02:19:27 +08:00
DEV: Remove rfc176-shims
Ember has now migrated to the new module layout, so these shims are no longer required
This commit is contained in:
parent
13bc2f1f39
commit
0ac90abcfa
|
@ -1 +0,0 @@
|
|||
engine-strict = true
|
|
@ -1,61 +0,0 @@
|
|||
"use strict";
|
||||
|
||||
// In core, babel-plugin-ember-modules-api-polyfill takes care of re-writing the new module
|
||||
// syntax to the legacy Ember globals. For themes and plugins, we need to manually set up
|
||||
// the modules.
|
||||
//
|
||||
// Eventually, Ember RFC176 will be implemented, and we can drop these shims.
|
||||
|
||||
const RFC176Data = require("ember-rfc176-data");
|
||||
|
||||
module.exports = {
|
||||
name: require("./package").name,
|
||||
|
||||
isDevelopingAddon() {
|
||||
return true;
|
||||
},
|
||||
|
||||
contentFor: function (type) {
|
||||
if (type !== "vendor-suffix") {
|
||||
return;
|
||||
}
|
||||
|
||||
const modules = {};
|
||||
|
||||
for (const entry of RFC176Data) {
|
||||
// Entries look like:
|
||||
// {
|
||||
// global: 'Ember.expandProperties',
|
||||
// module: '@ember/object/computed',
|
||||
// export: 'expandProperties',
|
||||
// deprecated: false
|
||||
// },
|
||||
|
||||
if (entry.deprecated) {
|
||||
continue;
|
||||
}
|
||||
|
||||
let m = modules[entry.module];
|
||||
if (!m) {
|
||||
m = modules[entry.module] = [];
|
||||
}
|
||||
|
||||
if (entry.module === "@ember/test") {
|
||||
m.push({ ...entry, global: `(Ember.Test && ${entry.global})` });
|
||||
} else {
|
||||
m.push(entry);
|
||||
}
|
||||
}
|
||||
|
||||
let output = "";
|
||||
for (const moduleName of Object.keys(modules)) {
|
||||
const exports = modules[moduleName];
|
||||
const rawExports = exports
|
||||
.map((e) => `${e.export}:${e.global}`)
|
||||
.join(",");
|
||||
output += `define("${moduleName}", () => {return {${rawExports}}});\n`;
|
||||
}
|
||||
|
||||
return output;
|
||||
},
|
||||
};
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"name": "rfc176-shims",
|
||||
"keywords": [
|
||||
"ember-addon"
|
||||
]
|
||||
}
|
|
@ -89,8 +89,7 @@
|
|||
},
|
||||
"ember-addon": {
|
||||
"paths": [
|
||||
"lib/bootstrap-json",
|
||||
"lib/rfc176-shims"
|
||||
"lib/bootstrap-json"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
Loading…
Reference in New Issue
Block a user