From f27800ff8896ca1038a379ef3efcda4cd185a6e8 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Mon, 11 Sep 2023 16:03:27 +0200 Subject: [PATCH] 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!) --- app/assets/javascripts/discourse/app/app.js | 2 +- app/assets/javascripts/discourse/app/mapping-router.js | 2 +- .../javascripts/discourse/tests/helpers/fixture-pretender.js | 2 +- .../pretty-text/addon/engines/discourse-markdown-it.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/discourse/app/app.js b/app/assets/javascripts/discourse/app/app.js index b781dd8d9f6..1593ebe5057 100644 --- a/app/assets/javascripts/discourse/app/app.js +++ b/app/assets/javascripts/discourse/app/app.js @@ -90,7 +90,7 @@ function loadInitializers(app) { let discourseInitializers = []; 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")) { // In discourse core, initializers follow standard Ember conventions if (moduleName.startsWith("discourse/initializers/")) { diff --git a/app/assets/javascripts/discourse/app/mapping-router.js b/app/assets/javascripts/discourse/app/mapping-router.js index 9f372413af3..2ebe0500998 100644 --- a/app/assets/javascripts/discourse/app/mapping-router.js +++ b/app/assets/javascripts/discourse/app/mapping-router.js @@ -111,7 +111,7 @@ export function mapRoutes() { // will be built automatically. You can supply a `resource` property to // automatically put it in that resource, such as `admin`. That way plugins // can define admin routes. - Object.keys(requirejs._eak_seen).forEach(function (key) { + Object.keys(requirejs.entries).forEach(function (key) { if (/route-map$/.test(key)) { let module = requirejs(key, null, null, true); if (!module || !module.default) { diff --git a/app/assets/javascripts/discourse/tests/helpers/fixture-pretender.js b/app/assets/javascripts/discourse/tests/helpers/fixture-pretender.js index 465984b1ceb..993b8115686 100644 --- a/app/assets/javascripts/discourse/tests/helpers/fixture-pretender.js +++ b/app/assets/javascripts/discourse/tests/helpers/fixture-pretender.js @@ -3,7 +3,7 @@ export default function (helpers) { const fixturesByUrl = {}; // Load any fixtures automatically - Object.keys(require._eak_seen).forEach((entry) => { + Object.keys(require.entries).forEach((entry) => { if (/^discourse\/tests\/fixtures/.test(entry)) { const fixture = require(entry, null, null, true); if (fixture && fixture.default) { diff --git a/app/assets/javascripts/pretty-text/addon/engines/discourse-markdown-it.js b/app/assets/javascripts/pretty-text/addon/engines/discourse-markdown-it.js index e15ff31af27..d0f91e3329e 100644 --- a/app/assets/javascripts/pretty-text/addon/engines/discourse-markdown-it.js +++ b/app/assets/javascripts/pretty-text/addon/engines/discourse-markdown-it.js @@ -479,7 +479,7 @@ export function setup(opts, siteSettings, state) { // all of the modules under discourse-markdown or markdown-it // directories are considered additional markdown "features" which // may define their own rules - Object.keys(require._eak_seen).forEach((entry) => { + Object.keys(require.entries).forEach((entry) => { if (check.test(entry)) { const module = requirejs(entry); if (module && module.setup) {