@modern-js/utils 2.8.1-alpha.0 → 2.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # @modern-js/utils
2
2
 
3
+ ## 2.9.0
4
+
3
5
  ## 2.8.0
4
6
 
5
7
  ### Patch Changes
@@ -50,7 +50,7 @@ const transformNestedRoutes = (routes) => {
50
50
  return (0, import_react_router_dom.createRoutesFromElements)(routeElements);
51
51
  };
52
52
  const renderNestedRoute = (nestedRoute, options = {}) => {
53
- const { children, index, id, component, isRoot, lazyImport } = nestedRoute;
53
+ const { children, index, id, component, isRoot } = nestedRoute;
54
54
  const Component = component;
55
55
  const { parent, DeferredDataComponent } = options;
56
56
  const routeProps = {
@@ -72,24 +72,22 @@ const renderNestedRoute = (nestedRoute, options = {}) => {
72
72
  }
73
73
  let element;
74
74
  if (Component) {
75
- if ((parent == null ? void 0 : parent.loading) && lazyImport) {
75
+ if (parent == null ? void 0 : parent.loading) {
76
76
  const Loading = parent.loading;
77
77
  if (isLoadableComponent(Component)) {
78
78
  element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, { fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {}) });
79
79
  } else {
80
80
  element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Loading, {}), children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}) });
81
81
  }
82
- } else if (isLoadableComponent(Component) && lazyImport) {
82
+ } else if (isLoadableComponent(Component)) {
83
83
  element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {});
84
84
  } else if (isRoot) {
85
85
  element = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
86
86
  /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}),
87
87
  typeof document === "undefined" && DeferredDataComponent && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(DeferredDataComponent, {})
88
88
  ] });
89
- } else if (lazyImport) {
90
- element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}) });
91
89
  } else {
92
- element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {});
90
+ element = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.Suspense, { fallback: null, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Component, {}) });
93
91
  }
94
92
  } else {
95
93
  nestedRoute.loading = parent == null ? void 0 : parent.loading;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.8.1-alpha.0",
14
+ "version": "2.9.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/index.d.ts",
17
17
  "main": "./dist/index.js",
@@ -167,9 +167,9 @@
167
167
  "typescript": "^4",
168
168
  "webpack": "^5.75.0",
169
169
  "@types/serialize-javascript": "^5.0.1",
170
- "@modern-js/types": "2.8.0",
171
- "@scripts/build": "2.8.0",
172
- "@scripts/jest-config": "2.8.0"
170
+ "@modern-js/types": "2.9.0",
171
+ "@scripts/jest-config": "2.9.0",
172
+ "@scripts/build": "2.9.0"
173
173
  },
174
174
  "sideEffects": false,
175
175
  "scripts": {