Skip to content

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

Conversation

lumirlumir
Copy link
Owner

@lumirlumir lumirlumir commented Apr 20, 2025

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:

  • Added Babel dependencies (@babel/core, @babel/preset-env, and babel-loader) to packages/bananass/package.json to enable transpilation of modern JavaScript features.

Build Process Modifications:

  • Replaced esbuild-loader with babel-loader in the bananass-build command. Configured Babel to target Node.js 16.13 and use @babel/preset-env for transpilation.

Test Additions:

  • Updated cjs.test.js and mjs.test.js to include new test cases verifying the correct transpilation of ES2025 features, specifically regexp-modifiers. These tests ensure that the transpiled output matches expectations and executes correctly. [1] [2]
  • Added fixtures (3000.js) for both CommonJS and ES module formats to test the new Babel transpilation capabilities. [1] [2]

Copy link

vercel bot commented Apr 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
npm-bananass-websites-eslint-config-bananass ⬜️ Skipped (Inspect) Apr 20, 2025 3:11pm
npm-bananass-websites-vitepress ⬜️ Skipped (Inspect) Apr 20, 2025 3:11pm

@github-actions github-actions bot added 🏷️ scope: bananass Auto-generated label based on Conventional Commits specification for GitHub release notes 🏷️ type: fix Auto-generated label based on Conventional Commits specification for GitHub release notes labels Apr 20, 2025
Copy link

Labels have been automatically applied based on the Conventional Commits specification.🏷️

Copy link

codecov bot commented Apr 20, 2025

Bundle Report

Bundle size has no change ✅

Copy link

codecov bot commented Apr 20, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.32%. Comparing base (7db03ca) to head (2cca51d).
Report is 1 commits behind head on main.

@@           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           
Files with missing lines Coverage Δ
...ages/bananass/src/commands/bananass-build/build.js 95.39% <100.00%> (+0.17%) ⬆️

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7db03ca...2cca51d. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@vercel vercel bot temporarily deployed to Preview – npm-bananass-websites-eslint-config-bananass April 20, 2025 14:48 Inactive
@vercel vercel bot temporarily deployed to Preview – npm-bananass-websites-vitepress April 20, 2025 14:48 Inactive
@vercel vercel bot temporarily deployed to Preview – npm-bananass-websites-eslint-config-bananass April 20, 2025 15:11 Inactive
@vercel vercel bot temporarily deployed to Preview – npm-bananass-websites-vitepress April 20, 2025 15:11 Inactive
@lumirlumir lumirlumir marked this pull request as ready for review April 20, 2025 15:13
@Copilot Copilot AI review requested due to automatic review settings April 20, 2025 15:13
Copy link
Contributor

@Copilot Copilot AI left a 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

@lumirlumir lumirlumir merged commit 814e478 into main Apr 20, 2025
14 checks passed
@lumirlumir lumirlumir deleted the fix-replace-esbuild-loader-with-babel-loader-for-js-code-bundling branch April 20, 2025 15:16
lumirlumir added a commit that referenced this pull request Apr 24, 2025
….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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ scope: bananass Auto-generated label based on Conventional Commits specification for GitHub release notes 🏷️ type: fix Auto-generated label based on Conventional Commits specification for GitHub release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy