Skip to content

v3.1#235

Closed
moonglum wants to merge 2 commits into
mainfrom
1.11
Closed

v3.1#235
moonglum wants to merge 2 commits into
mainfrom
1.11

Conversation

@moonglum

@moonglum moonglum commented Mar 13, 2026

Copy link
Copy Markdown
Member

Proposal for changes in v3.1:

  • Inline determining the browserslist as we plan to drop it from core
  • Add deprecation warnings for things we want to drop in the next major version:
    • esnext: The days of ES5 are long gone, and nowadays Babel does transformations we would not recommend. So let's drop it.
    • format: Why would you compile to anything but ESM? Let's drop it. It is the default right now, and I would be surprised if any project that is still alive would change it to something else.
    • mangling the source code: There is no reason to shorten variable names because compression exists. Reducing whitespace is a non-destructive option (modern browsers even have "format JS" as an option in the devtools), and makes a difference in file size even with compression, so we keep it.

Comment thread package.json
"dependencies": {
"@rollup/plugin-commonjs": "~29.0.1",
"@rollup/plugin-node-resolve": "~16.0.3",
"browserslist": "^4.28.1",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this doesn't add a dependency, as this is currently a transitive dependency via core

Comment thread lib/index.js

function faucetJS(config, assetManager, { browsers, compact, sourcemaps } = {}) {
function faucetJS(config, assetManager, { compact, sourcemaps } = {}) {
let browsers = browserslist.findConfig(assetManager.referenceDir) || {};

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This basically just moves the code that is deleted in core in this PR:
https://github.com/faucet-pipeline/faucet-pipeline-core/pull/168/changes

@moonglum moonglum changed the title inlined determing the browsers to be compatible with changes in -core v3.1 Mar 13, 2026
@moonglum

Copy link
Copy Markdown
Member Author

@FND Do you understand why the tests fail? I don't really get it.

@moonglum
moonglum requested a review from FND March 13, 2026 13:54
@moonglum

Copy link
Copy Markdown
Member Author

After removing the deprecated options, we have the following configuration options left:

  • source and target, obviously
  • externals to mark a module as external to the bundle
  • sourcemap: false to opt out a single bundle from the --sourcemaps CLI option. Any idea why we need that? 😕
  • compact: By default, -js does nothing when a user adds --compact. You need to opt-in. You can either set it to true to "comments, trim trailing spaces, compact empty lines, and normalize line endings" or minify to additionally reduce whitespace.
  • typescript: Currently does the whole typechecking-thing, but in the future should only strip types.
  • jsx: For purveyors of sparkling components.

I think this will allow us to give esbuild another try for the next major version:

  • externals is supported
  • Removing whitespace is supported, but I don't think there is an option equivalent to true (see above).
  • Type Striping is supported
  • JSX is supported

I would argue that there should only be to options for compact:

  • false: Do not compact in any way
  • true (default): Reduce whitespace and remove comments

Note that compact only has an effect if you run faucet with --compact

@moonglum moonglum closed this Mar 13, 2026
@moonglum

Copy link
Copy Markdown
Member Author

Changes merged into #236

@moonglum
moonglum deleted the 1.11 branch March 13, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant