@modern-js/runtime-utils 3.0.0-alpha.2 → 3.0.1

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.
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  function invariant(value, message) {
4
3
  if (false === value || null == value) throw new Error(message);
5
4
  }
@@ -1,4 +1,3 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  export * from "./nestedRoutes.mjs";
4
3
  export * from "./deferreds.mjs";
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  import { jsx } from "react/jsx-runtime";
4
3
  import { LOADER_REPORTER_NAME } from "@modern-js/utils/universal/constants";
5
4
  import { Suspense } from "react";
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  function isObject(obj) {
4
3
  return obj && 'object' == typeof obj && !Array.isArray(obj);
5
4
  }
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  import fs_extra from "@modern-js/utils/fs-extra";
4
3
  import { createMemoryStorage } from "./storer/index.mjs";
5
4
  class FileReader {
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  import { storage } from "../universal/async_storage.server.mjs";
4
3
  import { serializeJson } from "./serialize.mjs";
5
4
  export * from "./loaderContext/index.mjs";
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  class LoaderContext {
4
3
  getDefaultValue() {
5
4
  if (!this.defaultValue) throw new Error("Can't get defaultValue before initialed");
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  function createRequestContext(context) {
4
3
  const _context = context || new Map();
5
4
  function get(key) {
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  import { createLoaderContext } from "./createLoaderCtx.mjs";
4
3
  import { createRequestContext } from "./createRequestCtx.mjs";
5
4
  const reporterCtx = createLoaderContext();
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  import serialize_javascript from "serialize-javascript";
4
3
  const serializeJson = (data)=>serialize_javascript(data, {
5
4
  isJSON: true
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  import { LRUCache } from "lru-cache";
4
3
  class MemoryContainer {
5
4
  async get(key) {
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  import { MemoryContainer } from "./container.mjs";
4
3
  import { Storage } from "./storage.mjs";
5
4
  const memoryContainer = new MemoryContainer();
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  class Storage {
4
3
  async keys() {
5
4
  const _keys = [];
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  const parsedJSONFromElement = (id)=>{
4
3
  const elements = document.querySelectorAll(`#${id}`);
5
4
  if (0 === elements.length) return;
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  export * from "react-router";
4
3
  const DEFERRED_SYMBOL = Symbol('deferred');
5
4
  const json = (data, init)=>{
@@ -1,3 +1,2 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  export * from "react-router";
@@ -1,3 +1,2 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  export * from "./nestedRoutes.mjs";
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  function sortByUrlPath(entries) {
4
3
  entries.sort(function(a, b) {
5
4
  const length1 = a.urlPath.length;
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  function processHrtime(previousTimestamp) {
4
3
  const now = new Date().getTime();
5
4
  const clocktime = 1e-3 * now;
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  const isBrowser = "u" > typeof window && void 0 !== window.document;
4
3
  const IS_WEB_FALLBACK = "u" > typeof IS_WEB ? IS_WEB : isBrowser;
5
4
  const getAsyncLocalStorage = async ()=>{
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  import { AsyncLocalStorage } from "async_hooks";
4
3
  const createStorage = ()=>{
5
4
  let storage;
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  import { LRUCache } from "lru-cache";
4
3
  import { getAsyncLocalStorage } from "./async_storage.mjs";
5
4
  const CacheSize = {
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  function parseQuery(req) {
4
3
  const query = {};
5
4
  const { url } = req;
@@ -1,5 +1,4 @@
1
1
  import "node:module";
2
- /*#__PURE__*/ import.meta.url;
3
2
  function normalizePathname(pathname) {
4
3
  const normalized = '/' + pathname.replace(/^\/+|\/+$/g, '');
5
4
  return normalized;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "3.0.0-alpha.2",
18
+ "version": "3.0.1",
19
19
  "_comment": "Provide ESM and CJS exports, ESM is used by runtime package, for treeshaking",
20
20
  "exports": {
21
21
  "./router": {
@@ -159,8 +159,8 @@
159
159
  "lru-cache": "^10.4.3",
160
160
  "react-router": "7.13.0",
161
161
  "serialize-javascript": "^6.0.2",
162
- "@modern-js/types": "3.0.0-alpha.2",
163
- "@modern-js/utils": "3.0.0-alpha.2"
162
+ "@modern-js/types": "3.0.1",
163
+ "@modern-js/utils": "3.0.1"
164
164
  },
165
165
  "peerDependencies": {
166
166
  "react": ">=17.0.2",
@@ -175,16 +175,16 @@
175
175
  }
176
176
  },
177
177
  "devDependencies": {
178
- "@rslib/core": "0.19.3",
178
+ "@rslib/core": "0.19.4",
179
179
  "@types/ioredis-mock": "^8.2.6",
180
180
  "@types/node": "^20",
181
181
  "@types/serialize-javascript": "^5.0.4",
182
182
  "ioredis-mock": "^8.13.1",
183
- "react": "^19.2.3",
184
- "react-dom": "^19.2.3",
183
+ "react": "^19.2.4",
184
+ "react-dom": "^19.2.4",
185
185
  "typescript": "^5",
186
- "@modern-js/rslib": "2.68.10",
187
- "@scripts/rstest-config": "2.66.0"
186
+ "@scripts/rstest-config": "2.66.0",
187
+ "@modern-js/rslib": "2.68.10"
188
188
  },
189
189
  "sideEffects": false,
190
190
  "scripts": {