Skip to content

Commit 0d501d4

Browse files
committed
enhance: Polyfills no longer pollute global scope
1 parent 89a46c9 commit 0d501d4

29 files changed

+143
-88
lines changed

.changeset/wet-ravens-report.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@data-client/use-enhanced-reducer': patch
3+
'@data-client/normalizr': patch
4+
'@data-client/endpoint': patch
5+
'@data-client/graphql': patch
6+
'@data-client/react': patch
7+
'@data-client/core': patch
8+
'@data-client/rest': patch
9+
'@data-client/test': patch
10+
'@data-client/img': patch
11+
---
12+
13+
Polyfills no longer pollute global scope

.github/renovate.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"enabled": false
2323
},
2424
{
25-
"matchPackageNames": ["@babel/runtime", "core-js", "core-js-compat"],
25+
"matchPackageNames": ["@babel/runtime", "@babel/runtime-corejs3", "core-js", "core-js-pure", "core-js-compat"],
2626
"matchDepTypes": ["dependencies"],
2727
"rangeStrategy": "replace"
2828
},
@@ -69,7 +69,10 @@
6969
"matchUpdateTypes": ["major", "minor", "patch"],
7070
"matchPackageNames": [
7171
"@anansi/babel-preset",
72+
"@babel/runtime",
73+
"@babel/runtime-corejs3",
7274
"core-js",
75+
"core-js-pure",
7376
"core-js-compat"
7477
],
7578
"groupSlug": "build",

babel.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ const fs = require('fs');
33
const path = require('path');
44

55
module.exports = function (api) {
6-
api.cache.using(() => process.env.NODE_ENV);
6+
api.cache.using(
7+
() => process.env.NODE_ENV + process.env.BROWSERSLIST_ENV + '0',
8+
);
79
return {
810
presets: [
911
[

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
"benchmark": "^2.1.4",
8181
"conventional-changelog-anansi": "^0.2.0",
8282
"copyfiles": "^2.4.1",
83-
"core-js": "3.40.0",
83+
"core-js": "^3.40.0",
8484
"coveralls": "^3.1.0",
8585
"cpy-cli": "5.0.0",
8686
"cross-fetch": "^4.0.0",

packages/core/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,9 @@
120120
"url": "https://github.com/reactive/data-client/issues"
121121
},
122122
"dependencies": {
123-
"@babel/runtime": "^7.17.0",
123+
"@babel/runtime-corejs3": "^7.26.0",
124124
"@data-client/normalizr": "^0.14.16",
125+
"core-js-pure": "^3.40.0",
125126
"flux-standard-action": "^2.1.1"
126127
},
127128
"devDependencies": {

packages/core/rollup.config.mjs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,20 @@
1-
import { babel, commonjs, filesize, json, resolve, replace, terser, typeConfig, typeConfigNext } from 'rollup-plugins';
1+
import {
2+
babel,
3+
commonjs,
4+
filesize,
5+
json,
6+
resolve,
7+
replace,
8+
terser,
9+
typeConfig,
10+
typeConfigNext,
11+
} from 'rollup-plugins';
212

313
import pkg from './package.json' with { type: 'json' };
414

5-
615
const dependencies = Object.keys(pkg.dependencies)
716
//.concat(Object.keys(pkg.peerDependencies))
8-
.filter(dep => !['@babel/runtime'].includes(dep));
17+
.filter(dep => ![].includes(dep));
918

1019
const extensions = ['.js', '.ts', '.tsx', '.mjs', '.json', '.node', '.jsx'];
1120
const nativeExtensions = ['.native.ts', ...extensions];

packages/core/src/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
Object.hasOwn =
2-
Object.hasOwn ||
3-
/* istanbul ignore next */ function hasOwn(it, key) {
4-
return Object.prototype.hasOwnProperty.call(it, key);
5-
};
6-
71
export * as __INTERNAL__ from './internal.js';
82
export type {
93
NetworkError,

packages/endpoint/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,8 @@
131131
"url": "https://github.com/reactive/data-client/issues"
132132
},
133133
"dependencies": {
134-
"@babel/runtime": "^7.17.0"
134+
"@babel/runtime-corejs3": "^7.26.0",
135+
"core-js-pure": "^3.40.0"
135136
},
136137
"devDependencies": {
137138
"@anansi/browserslist-config": "^1.4.2",

packages/endpoint/rollup.config.mjs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1-
import { babel, dts, commonjs, filesize, json, resolve, replace, terser } from 'rollup-plugins';
1+
import {
2+
babel,
3+
dts,
4+
commonjs,
5+
filesize,
6+
json,
7+
resolve,
8+
replace,
9+
terser,
10+
} from 'rollup-plugins';
211

312
import pkg from './package.json' with { type: 'json' };
413

514
const dependencies = Object.keys(pkg.dependencies).filter(
6-
dep => !['@babel/runtime'].includes(dep),
15+
dep => ![].includes(dep),
716
);
817

918
const extensions = ['.js', '.ts', '.tsx', '.mjs', '.json', '.node'];

packages/endpoint/src/index.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
Object.hasOwn =
2-
Object.hasOwn ||
3-
/* istanbul ignore next */ function hasOwn(it, key) {
4-
return Object.prototype.hasOwnProperty.call(it, key);
5-
};
6-
71
export type {
82
EndpointOptions,
93
EndpointInstance,

0 commit comments

Comments
 (0)