-
-
Notifications
You must be signed in to change notification settings - Fork 1
fix(bananass): replace esbuild loader with babel loader for js code bundling #344
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
fix(bananass): replace esbuild loader with babel loader for js code bundling #344
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ |
Labels have been automatically applied based on the Conventional Commits specification.🏷️ |
Bundle ReportBundle size has no change ✅ |
Codecov ReportAll modified and coverable lines are covered by tests ✅
@@ Coverage Diff @@
## main #344 +/- ##
=======================================
Coverage 98.32% 98.32%
=======================================
Files 162 162
Lines 9664 9672 +8
Branches 16 16
=======================================
+ Hits 9502 9510 +8
Misses 162 162
Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
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.
Pull Request Overview
This PR replaces the esbuild-loader with babel-loader for bundling JavaScript code and updates tests to verify that the latest ECMAScript features (specifically regexp modifiers) are transpiled correctly using @babel/preset-env. Key changes include:
- Updating the webpack configuration in build.js to use babel-loader and new target options.
- Adding new test suites in both mjs and cjs test files for verifying ES2025 regexp-modifiers transformation.
- Introducing fixture files for both mjs and cjs modules containing the new solution function.
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
tests/e2e/bananass-build/mjs.test.js | Updates to import readFileSync and new tests for ES regexp-modifiers with fs and rl templates. |
tests/e2e/bananass-build/fixtures/mjs/bananass/3000.js | New fixture file with a solution function using a regexp-modifiers example. |
tests/e2e/bananass-build/fixtures/cjs/bananass/3000.js | New fixture file (cjs) with the same solution function as the mjs version. |
tests/e2e/bananass-build/cjs.test.js | Adds similar tests to those in the mjs test file for ECMAScript transpilation verification. |
packages/bananass/src/commands/bananass-build/build.js | Updates loader configuration from esbuild-loader to babel-loader with revised target options. |
Files not reviewed (1)
- packages/bananass/package.json: Language not supported
….0-canary.3` (`prerelease`) (#362) ## Release Information: `v0.1.0-canary.3` New release of `lumirlumir/npm-bananass` has arrived! 🎉 This PR bumps the package versions from `v0.1.0-canary.2` to `v0.1.0-canary.3` (`prerelease`). See [Actions](https://github.com/lumirlumir/npm-bananass/actions/runs/14634205891) for more details. | Info | Value | | ----------- | -------------------------- | | Repository | `lumirlumir/npm-bananass` | | SEMVER | `prerelease` | | Pre ID | `canary` | | Short SHA | cf78531 | | Old Version | `v0.1.0-canary.2` | | New Version | `v0.1.0-canary.3` | <!-- Release notes generated using configuration in .github/release.yml at main --> ## What's Changed ### ✨ Features * feat(bananass): support `Array.prototype.toSorted` transpilation using custom babel plugin by @lumirlumir in #350 * feat(bananass): support `Array.prototype.toReversed` transpilation using custom babel plugin by @lumirlumir in #351 * feat(bananass): support `Object.hasOwn` transpilation using custom babel plugin by @lumirlumir in #356 * feat(bananass): add support computed bracket form for `toSorted` and `toReversed` by @lumirlumir in #357 ### 🐛 Bug Fixes * fix(eslint-config-bananass): enhance JSDoc template and update types in `index.js` by @lumirlumir in #338 * fix(bananass): replace esbuild loader with babel loader for js code bundling by @lumirlumir in #344 * fix(bananass): drop esbuild-loader and create e2e tests for bananass build with mts module system by @lumirlumir in #360 * fix(bananass): fix `.cts` module interop and create e2e tests for bananass build with `cts` module system by @lumirlumir in #361 ### 🧰 Chores * chore(*): install `@types/node` and update `lint-staged` configuration by @lumirlumir in #337 ### 📝 Documentation * docs(*): update `README.md`, `README.en.md`, and `CONTRIBUTING.md` by @lumirlumir in #336 ### ♻️ Code Refactoring * refactor(bananass): minor tweaks and cleanup by @lumirlumir in #343 * refactor(bananass): remove unused cli commands (`random`, `testcase`) and cleanup by @lumirlumir in #359 ### 🧪 Tests * test(*): create e2e tests for bananass-build with `cjs` module system by @lumirlumir in #341 * test(tests-e2e): create e2e tests for bananass build with `mjs` module system by @lumirlumir in #342 * test(*): create integration tests for package json `engines.node` field by @lumirlumir in #358 ### ⬆️ Dependency Updates * chore(deps): bump the typescript-eslint group across 2 directories with 2 updates by @dependabot in #331 * chore(deps-dev): bump vitepress-plugin-group-icons from 1.5.1 to 1.5.2 by @dependabot in #332 * chore(deps): bump open from 10.1.0 to 10.1.1 by @dependabot in #334 * chore(deps): bump the next group across 2 directories with 1 update by @dependabot in #340 * chore(deps): bump webpack from 5.99.5 to 5.99.6 by @dependabot in #345 * chore(deps-dev): bump eslint from 9.24.0 to 9.25.0 by @dependabot in #347 * chore(deps): bump the typescript-eslint group across 2 directories with 2 updates by @dependabot in #352 * chore(deps-dev): bump eslint from 9.25.0 to 9.25.1 by @dependabot in #353 **Full Changelog**: v0.1.0-canary.2...v0.1.0-canary.3
This pull request introduces Babel into the
bananass
package to ensure compatibility with modern ECMAScript features and updates the build process accordingly. It also adds comprehensive end-to-end tests to validate the transpilation of ES2025 features. Key changes are grouped into dependency updates, build process modifications, and test additions.Dependency Updates:
@babel/core
,@babel/preset-env
, andbabel-loader
) topackages/bananass/package.json
to enable transpilation of modern JavaScript features.Build Process Modifications:
esbuild-loader
withbabel-loader
in thebananass-build
command. Configured Babel to target Node.js 16.13 and use@babel/preset-env
for transpilation.Test Additions:
cjs.test.js
andmjs.test.js
to include new test cases verifying the correct transpilation of ES2025 features, specificallyregexp-modifiers
. These tests ensure that the transpiled output matches expectations and executes correctly. [1] [2]3000.js
) for both CommonJS and ES module formats to test the new Babel transpilation capabilities. [1] [2]