@modern-js/plugin-data-loader 2.5.0 → 2.6.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.
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -28,6 +28,9 @@ async function loader(source) {
28
28
  if (target === "node") {
29
29
  return source;
30
30
  }
31
+ if (target === "webworker") {
32
+ return source;
33
+ }
31
34
  const options = this.getOptions();
32
35
  const code = (0, import_generate_client.generateClient)({
33
36
  mapFile: options.mapFile,
@@ -17,6 +17,10 @@ var __copyProps = (to, from, except, desc) => {
17
17
  return to;
18
18
  };
19
19
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
20
24
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
21
25
  mod
22
26
  ));
@@ -59,6 +63,7 @@ const callRouteLoader = async ({
59
63
  loader,
60
64
  params,
61
65
  request,
66
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
62
67
  loadContext
63
68
  }) => {
64
69
  if (!loader) {
@@ -138,6 +138,12 @@ function _loader() {
138
138
  source
139
139
  ];
140
140
  }
141
+ if (target === "webworker") {
142
+ return [
143
+ 2,
144
+ source
145
+ ];
146
+ }
141
147
  options = this.getOptions();
142
148
  code = generateClient({
143
149
  mapFile: options.mapFile,
@@ -254,7 +254,8 @@ var json = function(data) {
254
254
  };
255
255
  var callRouteLoader = function() {
256
256
  var _ref = _asyncToGenerator(function(param) {
257
- var routeId, loader, params, request, loadContext, result, error;
257
+ var routeId, loader, params, request, // eslint-disable-next-line @typescript-eslint/no-unused-vars
258
+ loadContext, result, error;
258
259
  return __generator(this, function(_state) {
259
260
  switch(_state.label){
260
261
  case 0:
@@ -6,6 +6,9 @@ async function loader(source) {
6
6
  if (target === "node") {
7
7
  return source;
8
8
  }
9
+ if (target === "webworker") {
10
+ return source;
11
+ }
9
12
  const options = this.getOptions();
10
13
  const code = generateClient({
11
14
  mapFile: options.mapFile,
@@ -33,6 +33,7 @@ const callRouteLoader = async ({
33
33
  loader,
34
34
  params,
35
35
  request,
36
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
36
37
  loadContext
37
38
  }) => {
38
39
  if (!loader) {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "modern",
12
12
  "modern.js"
13
13
  ],
14
- "version": "2.5.0",
14
+ "version": "2.6.0",
15
15
  "jsnext:source": "./src/index.ts",
16
16
  "types": "./dist/types/index.d.ts",
17
17
  "main": "./dist/cjs/index.js",
@@ -42,7 +42,7 @@
42
42
  "@remix-run/node": "^1.9.0",
43
43
  "path-to-regexp": "^6.2.0",
44
44
  "react-router-dom": "^6.6.0",
45
- "@modern-js/utils": "2.5.0"
45
+ "@modern-js/utils": "2.6.0"
46
46
  },
47
47
  "devDependencies": {
48
48
  "@types/babel__core": "^7.1.15",
@@ -57,11 +57,11 @@
57
57
  "typescript": "^4",
58
58
  "webpack": "^5.75.0",
59
59
  "webpack-chain": "^6.5.1",
60
- "@modern-js/core": "2.5.0",
61
- "@modern-js/server-core": "2.5.0",
62
- "@modern-js/types": "2.5.0",
63
- "@scripts/jest-config": "2.5.0",
64
- "@scripts/build": "2.5.0"
60
+ "@modern-js/core": "2.6.0",
61
+ "@modern-js/server-core": "2.6.0",
62
+ "@modern-js/types": "2.6.0",
63
+ "@scripts/build": "2.6.0",
64
+ "@scripts/jest-config": "2.6.0"
65
65
  },
66
66
  "sideEffects": false,
67
67
  "publishConfig": {