Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove caller option check #1007

Merged
merged 4 commits into from Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
node-version: [14, 16, 18]
node-version: [14, 16, 18, 20]
webpack-version: ['5']
include:
- node-version: "14.15.0" # The minimum supported node version
Expand Down
426 changes: 213 additions & 213 deletions .yarn/releases/yarn-3.6.1.cjs → .yarn/releases/yarn-3.6.4.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
@@ -1 +1 @@
yarnPath: .yarn/releases/yarn-3.6.1.cjs
yarnPath: .yarn/releases/yarn-3.6.4.cjs
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -19,10 +19,10 @@
},
"devDependencies": {
"@ava/babel": "^1.0.1",
"@babel/cli": "^7.22.9",
"@babel/core": "^7.22.9",
"@babel/eslint-parser": "^7.22.9",
"@babel/preset-env": "^7.22.9",
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.3",
"@babel/eslint-parser": "^7.23.3",
"@babel/preset-env": "^7.23.3",
"ava": "^3.13.0",
"babel-plugin-react-intl": "^8.2.25",
"c8": "^8.0.0",
Expand All @@ -38,7 +38,7 @@
"react-intl-webpack-plugin": "^0.3.0",
"rimraf": "^5.0.1",
"semver": "7.5.2",
"webpack": "^5.74.0"
"webpack": "^5.89.0"
},
"scripts": {
"clean": "rimraf lib/",
Expand Down Expand Up @@ -118,5 +118,5 @@
"git add yarn.lock"
]
},
"packageManager": "yarn@3.6.1"
"packageManager": "yarn@3.6.4"
}
27 changes: 0 additions & 27 deletions src/injectCaller.js
@@ -1,8 +1,4 @@
const babel = require("@babel/core");

module.exports = function injectCaller(opts, target) {
if (!supportsCallerOption()) return opts;

return Object.assign({}, opts, {
caller: Object.assign(
{
Expand All @@ -25,26 +21,3 @@ module.exports = function injectCaller(opts, target) {
),
});
};

// TODO: We can remove this eventually, I'm just adding it so that people have
// a little time to migrate to the newer RCs of @babel/core without getting
// hard-to-diagnose errors about unknown 'caller' options.
let supportsCallerOptionFlag = undefined;
function supportsCallerOption() {
if (supportsCallerOptionFlag === undefined) {
try {
// Rather than try to match the Babel version, we just see if it throws
// when passed a 'caller' flag, and use that to decide if it is supported.
babel.loadPartialConfig({
caller: undefined,
babelrc: false,
configFile: false,
});
supportsCallerOptionFlag = true;
} catch (err) {
supportsCallerOptionFlag = false;
}
}

return supportsCallerOptionFlag;
}