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>
23 lines
624 B
JavaScript
23 lines
624 B
JavaScript
const nodeFetch = require('node-fetch')
|
|
const realFetch = nodeFetch.default || nodeFetch
|
|
|
|
const fetch = function (url, options) {
|
|
// Support schemaless URIs on the server for parity with the browser.
|
|
// Ex: //github.com/ -> https://github.com/
|
|
if (/^\/\//.test(url)) {
|
|
url = 'https:' + url
|
|
}
|
|
return realFetch.call(this, url, options)
|
|
}
|
|
|
|
fetch.ponyfill = true
|
|
|
|
module.exports = exports = fetch
|
|
exports.fetch = fetch
|
|
exports.Headers = nodeFetch.Headers
|
|
exports.Request = nodeFetch.Request
|
|
exports.Response = nodeFetch.Response
|
|
|
|
// Needed for TypeScript consumers without esModuleInterop.
|
|
exports.default = fetch
|