-
Notifications
You must be signed in to change notification settings - Fork 356
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
chore: simplify Babel configuration #10189
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,4 @@ | ||
module.exports = { | ||
presets: [ | ||
[ | ||
'@babel/preset-env', | ||
{ | ||
targets: { | ||
esmodules: true | ||
} | ||
} | ||
], | ||
'@babel/preset-typescript', | ||
'@babel/preset-react' | ||
], | ||
plugins: [ | ||
['@babel/plugin-proposal-decorators', { legacy: true }], | ||
'@babel/plugin-proposal-optional-chaining', | ||
'@babel/plugin-proposal-class-properties', | ||
'@babel/plugin-proposal-object-rest-spread' | ||
] | ||
presets: ['@babel/preset-typescript', '@babel/preset-react'], | ||
plugins: ['@babel/plugin-transform-modules-commonjs'] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,16 +24,10 @@ | |
}, | ||
"homepage": "https://github.com/patternfly/patternfly-react#readme", | ||
"devDependencies": { | ||
"@babel/core": "^7.21.8", | ||
"@babel/plugin-proposal-class-properties": "^7.18.6", | ||
"@babel/plugin-proposal-decorators": "^7.21.0", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.20.7", | ||
"@babel/plugin-proposal-optional-chaining": "^7.21.0", | ||
"@babel/plugin-proposal-private-methods": "^7.18.6", | ||
"@babel/plugin-proposal-private-property-in-object": "^7.21.0", | ||
"@babel/preset-env": "^7.21.5", | ||
"@babel/preset-react": "^7.18.6", | ||
"@babel/preset-typescript": "^7.21.5", | ||
"@babel/core": "^7.24.3", | ||
"@babel/plugin-transform-modules-commonjs": "^7.24.1", | ||
"@babel/preset-react": "^7.24.1", | ||
"@babel/preset-typescript": "^7.24.1", | ||
"@octokit/rest": "^20.0.0", | ||
"@testing-library/jest-dom": "^5.16.5", | ||
"@testing-library/react": "^13.4.0", | ||
|
@@ -43,8 +37,7 @@ | |
"@types/react-dom": "^18", | ||
"@typescript-eslint/eslint-plugin": "^5.59.2", | ||
"@typescript-eslint/parser": "^5.59.2", | ||
"babel-jest": "^27.2.5", | ||
"jest-transform-stub": "^2.0.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yarn moved some of these dependencies around for some reason, but they should all have still have the same version, so I left it as-is. |
||
"babel-jest": "^29.7.0", | ||
"concurrently": "^7.6.0", | ||
"eslint": "^8.39.0", | ||
"eslint-plugin-markdown": "^3.0.0", | ||
|
@@ -56,6 +49,7 @@ | |
"husky": "^4.3.0", | ||
"jest": "27.2.5", | ||
"jest-cli": "27.2.5", | ||
"jest-transform-stub": "^2.0.0", | ||
"lerna": "^7.1.5", | ||
"lint-staged": "^14.0.0", | ||
"mutation-observer": "^1.0.3", | ||
|
@@ -64,9 +58,9 @@ | |
"react": "^18", | ||
"react-dom": "^18", | ||
"surge": "^0.23.1", | ||
"ts-node": "^10.9.1", | ||
"ts-patch": "^2.1.0", | ||
"typescript": "^4.7.4", | ||
"ts-node": "^10.9.1" | ||
"typescript": "^4.7.4" | ||
}, | ||
"scripts": { | ||
"build": "yarn clean && yarn build:generate && yarn build:esm && yarn build:cjs && yarn build:subpaths && yarn build:single:packages", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed
transformIgnorePatterns
as the default already excludes thenode_modules
directory. It doesn't seem that any of the listed dependencies need to be included, the tests work fine without. Aside from that this also improves the startup time for test execution by about 5 seconds on my machine.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm I'd tried removing that option before and run into issues because of imports that we did need to transform, but if we're not seeing problems related to that when the unit tests run maybe we've resolved that issue in other ways.
If so that's AWESOME, if not we can always revert this change if need be, it's not like it will impact consumers even if it doesn't work out.