Repository navigation
Conversation
…re Node >=6 Effect, measured against upstream main (1343320): Bundle (esbuild --bundle --minify on dist/index.js, browser): minified 64,923 -> 48,944 B (-15,979 B, -24.6%) gzip -9 15,124 -> 13,313 B (-1,811 B, -12.0%) brotli 13,465 -> 11,952 B (-1,513 B, -11.2%) Install footprint (vs published 7.1.7 + its dependencies): 242,749 B in 3 packages -> 196,007 B in 1 package (-46,742 B, -19.3%) Runtime (Node 24, median of 9 runs): parse + stringify benchmark 336 -> 239 ms (-29%) className/attribute escaping 214 -> 89 ms (-58%) Compatibility: engines.node is bumped from >=4 to >=6. The dist is now ES2015 syntax (default/rest params, spread, classes), which Node 4/5 cannot run. Node 4 has been officially unsupported since 5.0.0-rc.1, and postcss 8 already requires Node ^10 || ^12 || >=14. Browser bundles that must ship ES5 (e.g. IE11) now need to transpile this package. Public API and outputs are unchanged. Changes, with cumulative gzip/minified savings applied in this order: - tsconfig target es5 -> es2015: -1,550 B gzip (-10.2%), -15,131 B min. ES5 output carried class/iterator downlevel helpers. - Inline cssesc as src/util/cssesc.js, trimmed to the options this package uses (isIdentifier, quotes, wrap), keeping the upstream MIT notice; drop the cssesc dependency: -191 B gzip (-1.3%), -443 B min. Output is identical to cssesc@3 on 1M fuzzed inputs. - Replace util-deprecate with a small helper that emits a DeprecationWarning via process.emitWarning on Node (so --no-deprecation, --throw-deprecation and process.on("warning") keep working) and falls back to console.warn elsewhere; drop the dependency: -74 B gzip (-0.5%), -191 B min. - Deduplicate the Container#walk* methods via a shared _walkType helper: +4 B gzip, -214 B min.
Contributor
Author
|
Apologies for the noise. I was experimenting with this locally, and Gemini got eager and published. I'll re-open this in a better state if there's any desire for it. Feel free to take anything you like from this PR if you feel so inclined. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Effect
All numbers are compared with
main.--bundle --minify,dist/index.js)Compatibility
Important
engines.nodegoes from>=4to>=6.CHANGELOG.md).^10 || ^12 || >=14.Changes
Savings are cumulative, with the changes applied in this order:
targetes5 → es2015cssescand drop the dependencyutil-deprecateand drop the dependencyContainer#walk*methodscssesccopy (src/util/cssesc.js): trimmed to the options this package uses (isIdentifier,quotes,wrap), with the upstream MIT notice kept. It was tested againstcssesc@3on 1M fuzzed inputs with 0 differences.process.emitWarning(msg, "DeprecationWarning"), so--no-deprecation,--throw-deprecationandprocess.on("warning")behave as before. Elsewhere it falls back toconsole.warn.Testing
npm test: lint, typecheck and coverage all pass (897/897 tests).npm run format:checkreports nothing new; the only flagged files were already flagged onmain.