@umijs/renderer-react
Advanced tools
Comparing version 4.2.6-alpha.25 to 4.2.6-alpha.26
@@ -264,32 +264,2 @@ import _defineProperty from "@babel/runtime/helpers/esm/defineProperty"; | ||
}; | ||
function clearBrowserExtensionInjectionsBeforeHydration() { | ||
document.querySelectorAll(['html > *:not(body, head)', 'script[src*="extension://"]', 'link[href*="extension://"]'].join(', ')).forEach(function (s) { | ||
var _s$parentNode; | ||
(_s$parentNode = s.parentNode) === null || _s$parentNode === void 0 || _s$parentNode.removeChild(s); | ||
}); | ||
var $targets = { | ||
html: { | ||
$elm: document.querySelector('html'), | ||
allowedAttributes: ['lang', 'dir', 'class'] | ||
}, | ||
head: { | ||
$elm: document.querySelector('head'), | ||
allowedAttributes: [''] | ||
}, | ||
body: { | ||
$elm: document.querySelector('body'), | ||
allowedAttributes: ['class'] | ||
} | ||
}; | ||
Object.entries($targets).forEach(function (_ref) { | ||
var _ref2 = _slicedToArray(_ref, 2), | ||
_ = _ref2[0], | ||
target = _ref2[1]; | ||
target.$elm.getAttributeNames().forEach(function (attr) { | ||
if (!target.allowedAttributes.includes(attr)) { | ||
target.$elm.removeAttribute(attr); | ||
} | ||
}); | ||
}); | ||
} | ||
@@ -314,5 +284,4 @@ /** | ||
}; | ||
var _isTern = opts.__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.pureApp || opts.__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.pureHtml; | ||
!_isTern && clearBrowserExtensionInjectionsBeforeHydration(); | ||
ReactDOM.hydrateRoot(_isTern ? rootElement : document, _isTern ? /*#__PURE__*/React.createElement(Browser, null) : /*#__PURE__*/React.createElement(Html, hydtateHtmloptions, /*#__PURE__*/React.createElement(Browser, null))); | ||
var _isInternal = opts.__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.pureApp || opts.__INTERNAL_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.pureHtml; | ||
ReactDOM.hydrateRoot(_isInternal ? rootElement : document, _isInternal ? /*#__PURE__*/React.createElement(Browser, null) : /*#__PURE__*/React.createElement(Html, hydtateHtmloptions, /*#__PURE__*/React.createElement(Browser, null))); | ||
return; | ||
@@ -319,0 +288,0 @@ } |
@@ -104,3 +104,4 @@ import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; | ||
}, | ||
key: key | ||
key: key, | ||
crossOrigin: "anonymous" | ||
}, rest)); | ||
@@ -163,3 +164,4 @@ })); | ||
}, | ||
key: key | ||
key: key, | ||
crossOrigin: "anonymous" | ||
}, rest)); | ||
@@ -166,0 +168,0 @@ }))) |
{ | ||
"name": "@umijs/renderer-react", | ||
"version": "4.2.6-alpha.25", | ||
"version": "4.2.6-alpha.26", | ||
"description": "@umijs/renderer-react", | ||
@@ -26,4 +26,4 @@ "homepage": "https://github.com/umijs/umi/tree/master/packages/renderer-react#readme", | ||
"devDependencies": { | ||
"react": "18.3.1", | ||
"react-dom": "18.3.1" | ||
"react": "19.0.0-rc-e684ca66ab-20240619", | ||
"react-dom": "19.0.0-rc-e684ca66ab-20240619" | ||
}, | ||
@@ -30,0 +30,0 @@ "peerDependencies": { |
45511
1087