Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
26 lines
1.1 KiB
JavaScript
26 lines
1.1 KiB
JavaScript
'use strict';
|
|
var $ = require('../internals/export');
|
|
var globalThis = require('../internals/global-this');
|
|
var microtask = require('../internals/microtask');
|
|
var aCallable = require('../internals/a-callable');
|
|
var validateArgumentsLength = require('../internals/validate-arguments-length');
|
|
var fails = require('../internals/fails');
|
|
var DESCRIPTORS = require('../internals/descriptors');
|
|
|
|
// Bun ~ 1.0.30 bug
|
|
// https://github.com/oven-sh/bun/issues/9249
|
|
var WRONG_ARITY = fails(function () {
|
|
// getOwnPropertyDescriptor for prevent experimental warning in Node 11
|
|
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
|
|
return DESCRIPTORS && Object.getOwnPropertyDescriptor(globalThis, 'queueMicrotask').value.length !== 1;
|
|
});
|
|
|
|
// `queueMicrotask` method
|
|
// https://html.spec.whatwg.org/multipage/timers-and-user-prompts.html#dom-queuemicrotask
|
|
$({ global: true, enumerable: true, dontCallGetSet: true, forced: WRONG_ARITY }, {
|
|
queueMicrotask: function queueMicrotask(fn) {
|
|
validateArgumentsLength(arguments.length, 1);
|
|
microtask(aCallable(fn));
|
|
}
|
|
});
|