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:
Jarek Radosz 2023-09-11 16:03:27 +02:00 committed by GitHub
parent 898c75a05c
commit f27800ff88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 4 deletions

View File

@ -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/")) {

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {