Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4,790 changes: 1,787 additions & 3,003 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

65 changes: 41 additions & 24 deletions packages/subapp-pkg-util/babelrc.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,56 @@
// Modernized Babel config using ES6+ and up-to-date presets/plugins
const assert = require("assert");
const envOpts = { modules: "auto" };

const config = {};

const babelEnv = process.env.BABEL_ENV || "";

assert(babelEnv, "env BABEL_ENV must be defined");

const envOpts = {};
const config = {};

if (babelEnv.includes("-node")) {
Object.assign(envOpts, { modules: "auto", targets: { node: "10" } });
Object.assign(envOpts, {
modules: "auto",
targets: { node: "current" }
});
} else {
Object.assign(envOpts, { modules: false, useBuiltIns: "entry", corejs: 3, targets: { ie: "8" } });
config.plugins = [
[
"@babel/transform-runtime",
{
helpers: true,
regenerator: false,
version: "7.8.3"
}
]
];
Object.assign(envOpts, {
modules: false,
useBuiltIns: "entry",
corejs: 3,
targets: "last 5 years and > 0.5% and not dead"
});
}

const presets = [["@babel/env", envOpts], "@babel/react"];
const presets = [
["@babel/preset-env", envOpts],
["@babel/preset-react", { runtime: "automatic" }]
];

if (babelEnv.includes("-minify")) {
presets.push([
"minify",
config.plugins = [
[
"@babel/plugin-transform-runtime",
{
removeDebugger: true,
removeConsole: { exclude: ["error", "warn"] }
helpers: true,
regenerator: false,
// version: "7.8.3" // version is auto-detected by Babel, usually not needed
}
]);
}
]
];

// The minify preset seems to be abandoned for a long time. As there is not major change happening and the github page says it is still beta version, we will not use it for now, instead we will have terser added to packages using this babelrc.
// Some references
// - https://www.npmjs.com/package/rollup-plugin-babel-minify
// - https://github.com/babel/minify?tab=readme-ov-file#experimental

// if (babelEnv.includes("-minify")) {
// presets.push([
// "minify",
// {
// removeDebugger: true,
// removeConsole: { exclude: ["error", "warn"] }
// }
// ]);
// }

Object.assign(config, { presets });

Expand Down
11 changes: 8 additions & 3 deletions packages/subapp-pkg-util/xclap.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,14 @@ xclap.load({
"compile-dev": exec("babel src -d dist/dev --delete-dir-on-start --source-maps", {
env: { BABEL_ENV: "-src-dev" }
}),
"compile-min": exec("babel src -d dist/min --no-comments --delete-dir-on-start", {
env: { BABEL_ENV: "-src-minify" }
}),
"compile-min": serial(
exec("babel src -d dist/min --no-comments --delete-dir-on-start", {
env: { BABEL_ENV: "-src-minify" }
}),
exec("for f in dist/min/*.js; do npx terser \"$f\" --compress --mangle --output \"$f\"; done", {
env: {}
})
),
"compile-node": exec("babel src -d dist/node --delete-dir-on-start --source-maps", {
env: { BABEL_ENV: "-src-node" }
})
Expand Down
5 changes: 5 additions & 0 deletions packages/subapp-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ import { React, loadSubApp } from "subapp-react";
export default loadSubApp({ name: "MySubapp", Component, useReactRouter: true });
```

## React 19 Support and Requirements

- This package requires `react@^19.1.0` and `react-dom@^19.1.0` as peer dependencies. Please ensure your application installs these versions.
- If you use React Router, you must use `react-router@^7` and `react-router-dom@^7`.

## License

Copyright (c) 2016-present, WalmartLabs
Expand Down
18 changes: 12 additions & 6 deletions packages/subapp-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"description": "Electrode subapp support for React/Redux/React Router",
"module": "dist/dev/index.js",
"main": "lib/index.js",
"exports": {
".": {
"require": "./lib/index.js",
"import": "./dist/dev/index.js"
}
},
"scripts": {
"test": "clap test",
"coverage": "clap coverage",
Expand Down Expand Up @@ -42,20 +48,20 @@
"@babel/register": "^7.22.15",
"@xarc/app": "^12.0.0",
"@xarc/run": "^1.1.1",
"babel-preset-minify": "^0.5.2",
"electrode-archetype-njs-module-dev": "^3.0.3",
"jsdom": "^23.0.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-redux": "^9.0.4",
"react-router": "^7.2.0",
"redux": "^5.0.0",
"run-verify": "^1.2.6",
"subapp-pkg-util": "0.0.1"
"subapp-pkg-util": "0.0.1",
"terser": "^5.42.0"
},
"peerDependencies": {
"react": "*",
"react-dom": "*",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router": "^7.1.5"
},
"nyc": {
Expand Down
2 changes: 1 addition & 1 deletion packages/subapp-react/test/spec/fe-framework.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use strict";

const React = require("react"); // eslint-disable-line
const { act } = require("react-dom/test-utils");
const { act } = require("react");
const feLib = require("../../src");
const { JSDOM } = require("jsdom");

Expand Down
22 changes: 14 additions & 8 deletions packages/subapp-redux/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"description": "Electrode subapp redux support",
"module": "dist/dev/index.js",
"main": "lib/index.js",
"exports": {
".": {
"require": "./lib/index.js",
"import": "./dist/dev/index.js"
}
},
"scripts": {
"test": "clap test",
"coverage": "clap coverage",
Expand Down Expand Up @@ -40,19 +46,19 @@
"@babel/runtime": "^7.17.9",
"@reduxjs/toolkit": ">= 2",
"@xarc/run": "^1.1.1",
"babel-preset-minify": "^0.5.1",
"electrode-archetype-njs-module-dev": "^3.0.3",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-redux": "^8.0.1",
"run-verify": "^1.2.6",
"subapp-pkg-util": "0.0.1"
"subapp-pkg-util": "0.0.1",
"terser": "^5.42.0"
},
"peerDependencies": {
"react": "*",
"react-dom": "*",
"react-redux": "*",
"redux": "*"
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-redux": "^8.0.1",
"@reduxjs/toolkit": ">=2"
},
"nyc": {
"all": true,
Expand Down
9 changes: 0 additions & 9 deletions packages/subapp-web/babelrc-node

This file was deleted.

10 changes: 8 additions & 2 deletions packages/subapp-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"description": "Electrode subapp web support",
"module": "dist/dev/index.js",
"main": "lib/index.js",
"exports": {
".": {
"import": "./dist/dev/index.js",
"require": "./lib/index.js"
}
},
"scripts": {
"test": "clap test",
"lint": "clap lint",
Expand Down Expand Up @@ -51,7 +57,6 @@
"@xarc/app": "^12.0.0",
"@xarc/module-dev": "^4.1.0",
"@xarc/run": "^1.1.1",
"babel-preset-minify": "^0.5.1",
"chai": "4.3.6",
"chai-as-promised": "^7.1.1",
"electrode-archetype-njs-module-dev": "^3.0.3",
Expand All @@ -64,7 +69,8 @@
"mocha": "^10.2.0",
"mock-require": "^3.0.3",
"run-verify": "^1.2.6",
"subapp-pkg-util": "0.0.1"
"subapp-pkg-util": "0.0.1",
"terser": "^5.42.0"
},
"nyc": {
"all": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/webpack-config-composer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"outDir": "lib",
"lib": ["es2018"],
"lib": ["ES2020"],
"module": "CommonJS",
"esModuleInterop": true,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/xarc-app-dev/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"outDir": "dist",
"lib": ["es2018"],
"lib": ["ES2020"],
"module": "CommonJS",
"esModuleInterop": true,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/xarc-app/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"outDir": "dist",
"lib": ["es2018"],
"lib": ["ES2020"],
"module": "CommonJS",
"esModuleInterop": true,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/xarc-dev-base/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"outDir": "dist",
"lib": ["es2018"],
"lib": ["es2020"],
"module": "CommonJS",
"esModuleInterop": true,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/xarc-index-page/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"compilerOptions": {
"outDir": "dist",
"lib": [
"es2018"
"ES2020"
],
"module": "CommonJS",
"esModuleInterop": false,
"importHelpers": true,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/xarc-jsx-renderer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"compilerOptions": {
"outDir": "dist",
"lib": ["es2018"],
"lib": ["es2020"],
"module": "CommonJS",
"esModuleInterop": false,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/xarc-opt-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
"prepare": "shx cp node_modules/opt-archetype-check/xarc-opt-check.js ."
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "^19.1.0",
"react-dom": "^19.1.0"
},
"devDependencies": {
"opt-archetype-check": "1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-react-query/tsconfig.browser.es2x.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"module": "ES2020",
"esModuleInterop": true,
"importHelpers": true,
"target": "ES2019",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-react-query/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"module": "CommonJS",
"esModuleInterop": true,
"importHelpers": true,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-react-query/tsconfig.node.cjs.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"module": "CommonJS",
"esModuleInterop": true,
"importHelpers": true,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-react-query/tsconfig.node.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"module": "ES2020",
"esModuleInterop": true,
"importHelpers": true,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
4 changes: 2 additions & 2 deletions packages/xarc-react-recoil/tsconfig.browser.es2x.esm.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"outDir": "dist-browser~es2x~esm~",
"jsx": "react",
"jsxFactory": "createElement",
"lib": ["es2018", "DOM"],
"lib": ["ES2020", "DOM"],
"module": "ES2020",
"esModuleInterop": true,
"importHelpers": true,
"target": "ES2019",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
2 changes: 1 addition & 1 deletion packages/xarc-react-recoil/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"module": "CommonJS",
"esModuleInterop": true,
"importHelpers": true,
"target": "ES2018",
"target": "ES2020",
"preserveConstEnums": true,
"sourceMap": true,
"declaration": true,
Expand Down
Loading