DEV: Replace `_eak_seen` with `entries` (#23507)
TIL: `require._eak_seen` is an old alias for `require.entries` and it comes from Ember App Kit (a blast from the past!)
This commit is contained in:
parent
898c75a05c
commit
f27800ff88
|
@ -90,7 +90,7 @@ function loadInitializers(app) {
|
||||||
let discourseInitializers = [];
|
let discourseInitializers = [];
|
||||||
let discourseInstanceInitializers = [];
|
let discourseInstanceInitializers = [];
|
||||||
|
|
||||||
for (let moduleName of Object.keys(requirejs._eak_seen)) {
|
for (let moduleName of Object.keys(requirejs.entries)) {
|
||||||
if (moduleName.startsWith("discourse/") && !moduleName.endsWith("-test")) {
|
if (moduleName.startsWith("discourse/") && !moduleName.endsWith("-test")) {
|
||||||
// In discourse core, initializers follow standard Ember conventions
|
// In discourse core, initializers follow standard Ember conventions
|
||||||
if (moduleName.startsWith("discourse/initializers/")) {
|
if (moduleName.startsWith("discourse/initializers/")) {
|
||||||
|
|
|
@ -111,7 +111,7 @@ export function mapRoutes() {
|
||||||
// will be built automatically. You can supply a `resource` property to
|
// will be built automatically. You can supply a `resource` property to
|
||||||
// automatically put it in that resource, such as `admin`. That way plugins
|
// automatically put it in that resource, such as `admin`. That way plugins
|
||||||
// can define admin routes.
|
// can define admin routes.
|
||||||
Object.keys(requirejs._eak_seen).forEach(function (key) {
|
Object.keys(requirejs.entries).forEach(function (key) {
|
||||||
if (/route-map$/.test(key)) {
|
if (/route-map$/.test(key)) {
|
||||||
let module = requirejs(key, null, null, true);
|
let module = requirejs(key, null, null, true);
|
||||||
if (!module || !module.default) {
|
if (!module || !module.default) {
|
||||||
|
|
|
@ -3,7 +3,7 @@ export default function (helpers) {
|
||||||
const fixturesByUrl = {};
|
const fixturesByUrl = {};
|
||||||
|
|
||||||
// Load any fixtures automatically
|
// Load any fixtures automatically
|
||||||
Object.keys(require._eak_seen).forEach((entry) => {
|
Object.keys(require.entries).forEach((entry) => {
|
||||||
if (/^discourse\/tests\/fixtures/.test(entry)) {
|
if (/^discourse\/tests\/fixtures/.test(entry)) {
|
||||||
const fixture = require(entry, null, null, true);
|
const fixture = require(entry, null, null, true);
|
||||||
if (fixture && fixture.default) {
|
if (fixture && fixture.default) {
|
||||||
|
|
|
@ -479,7 +479,7 @@ export function setup(opts, siteSettings, state) {
|
||||||
// all of the modules under discourse-markdown or markdown-it
|
// all of the modules under discourse-markdown or markdown-it
|
||||||
// directories are considered additional markdown "features" which
|
// directories are considered additional markdown "features" which
|
||||||
// may define their own rules
|
// may define their own rules
|
||||||
Object.keys(require._eak_seen).forEach((entry) => {
|
Object.keys(require.entries).forEach((entry) => {
|
||||||
if (check.test(entry)) {
|
if (check.test(entry)) {
|
||||||
const module = requirejs(entry);
|
const module = requirejs(entry);
|
||||||
if (module && module.setup) {
|
if (module && module.setup) {
|
||||||
|
|
Loading…
Reference in New Issue