react-rsc-utils currently bundles a copy of React, increasing the size of the bundle and making NextUI incompatible with Preact
For example, in version 2.0.13, a copy of React is included as dist/chunk-2GZPFWUB.mjs (the link to unpkg is for example, the same package is downloaded from npm):
import {
__commonJS
} from "./chunk-UYSIEMEK.mjs";
// ../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js
var require_react_production_min = __commonJS({
"../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.production.min.js"(exports) {
"use strict";
var l = Symbol.for("react.element");
var n = Symbol.for("react.portal");
/* ... the rest of the production build ... */
}
});
// ../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.js
var require_react_development = __commonJS({
"../../../node_modules/.pnpm/react@18.2.0/node_modules/react/cjs/react.development.js"(exports, module) {
"use strict";
if (process.env.NODE_ENV !== "production") {
/* ... the rest of the development build ... */
}
}
});
// ../../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.js
var require_react = __commonJS({
"../../../node_modules/.pnpm/react@18.2.0/node_modules/react/index.js"(exports, module) {
"use strict";
if (process.env.NODE_ENV === "production") {
module.exports = require_react_production_min();
} else {
module.exports = require_react_development();
}
}
});
export {
require_react
};
Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
N/A
Expected behavior
React should be imported as a peer dependency like in other packages, not included as a copy
NextUI Version
@nextui-org/react-rsc-utils@2.0.13
Describe the bug
react-rsc-utils
currently bundles a copy of React, increasing the size of the bundle and making NextUI incompatible with PreactFor example, in version
2.0.13
, a copy of React is included asdist/chunk-2GZPFWUB.mjs
(the link tounpkg
is for example, the same package is downloaded fromnpm
):Your Example Website or App
No response
Steps to Reproduce the Bug or Issue
N/A
Expected behavior
React should be imported as a peer dependency like in other packages, not included as a copy
It seems
react
should be specified inpeerDependencies
, like inreact-utils
? https://github.com/nextui-org/nextui/blob/be507e0c418299600c609d9101fc4a2ac1c35d38/packages/utilities/react-utils/package.json#L36-L38Screenshots or Videos
No response
Operating System Version
Linux
Browser
Chrome