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>
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
'use strict';
|
|
var $ = require('../internals/export');
|
|
var getBuiltIn = require('../internals/get-built-in');
|
|
var fails = require('../internals/fails');
|
|
var validateArgumentsLength = require('../internals/validate-arguments-length');
|
|
var toString = require('../internals/to-string');
|
|
var USE_NATIVE_URL = require('../internals/url-constructor-detection');
|
|
|
|
var URL = getBuiltIn('URL');
|
|
|
|
// https://github.com/nodejs/node/issues/47505
|
|
// https://github.com/denoland/deno/issues/18893
|
|
var THROWS_WITHOUT_ARGUMENTS = USE_NATIVE_URL && fails(function () {
|
|
URL.canParse();
|
|
});
|
|
|
|
// Bun ~ 1.0.30 bug
|
|
// https://github.com/oven-sh/bun/issues/9250
|
|
var WRONG_ARITY = fails(function () {
|
|
return URL.canParse.length !== 1;
|
|
});
|
|
|
|
// `URL.canParse` method
|
|
// https://url.spec.whatwg.org/#dom-url-canparse
|
|
$({ target: 'URL', stat: true, forced: !THROWS_WITHOUT_ARGUMENTS || WRONG_ARITY }, {
|
|
canParse: function canParse(url) {
|
|
var length = validateArgumentsLength(arguments.length, 1);
|
|
var urlString = toString(url);
|
|
var base = length < 2 || arguments[1] === undefined ? undefined : toString(arguments[1]);
|
|
try {
|
|
return !!new URL(urlString, base);
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
}
|
|
});
|