From 5d3be6a5f31771f9a25b95096a7f1695942a9644 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Vanvelthem?= Date: Thu, 26 Oct 2023 01:22:39 +0200 Subject: [PATCH] feat: drop node 16 - build for es2022 (#669) --- .changeset/nice-cooks-tan.md | 5 +++++ packages/dsn-parser/.size-limit.cjs | 4 ++-- packages/dsn-parser/package.json | 8 ++++---- packages/dsn-parser/tsup.config.mjs | 6 +++++- 4 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 .changeset/nice-cooks-tan.md diff --git a/.changeset/nice-cooks-tan.md b/.changeset/nice-cooks-tan.md new file mode 100644 index 000000000..21facd33c --- /dev/null +++ b/.changeset/nice-cooks-tan.md @@ -0,0 +1,5 @@ +--- +'@httpx/dsn-parser': minor +--- + +Drop node 16 support, es2022, slight bundle size decrease diff --git a/packages/dsn-parser/.size-limit.cjs b/packages/dsn-parser/.size-limit.cjs index b670bd9a9..6e57e853a 100644 --- a/packages/dsn-parser/.size-limit.cjs +++ b/packages/dsn-parser/.size-limit.cjs @@ -6,11 +6,11 @@ module.exports = [ { name: 'JS (ESM)', path: ['dist/index.mjs'], - limit: '1.30KB', + limit: '1.20KB', }, { name: 'JS (CJS)', path: ['dist/index.cjs'], - limit: '1.43KB', + limit: '1.20KB', }, ]; diff --git a/packages/dsn-parser/package.json b/packages/dsn-parser/package.json index 3336325f4..5f17435d4 100644 --- a/packages/dsn-parser/package.json +++ b/packages/dsn-parser/package.json @@ -23,7 +23,7 @@ "defaults and supports es6-module", "not dead", "not op_mini all", - "node 16" + "node 18" ], "main": "./dist/index.cjs", "module": "./dist/index.mjs", @@ -55,8 +55,8 @@ "docgen": "run-s docgen-typedoc", "docgen-typedoc": "rimraf ./docs/api && typedoc --plugin typedoc-plugin-markdown --out ./docs/api", "check-dist": "run-s check-dist-esm check-dist-cjs", - "check-dist-cjs": "es-check --not './dist/*.map.js' -v es2019 './dist/**/*.cjs'", - "check-dist-esm": "es-check --not './dist/*.map.js' -v es2019 --module './dist/**/*.mjs'", + "check-dist-cjs": "es-check --not './dist/*.map.js' -v es2022 './dist/**/*.cjs'", + "check-dist-esm": "es-check --not './dist/*.map.js' -v es2022 --module './dist/**/*.mjs'", "check-pub": "run-p check-pub-publint check-pub-attw", "check-pub-publint": "publint --strict", "check-pub-attw": "attw --pack", @@ -98,6 +98,6 @@ "vitest": "0.34.6" }, "engines": { - "node": ">=16" + "node": ">=18" } } diff --git a/packages/dsn-parser/tsup.config.mjs b/packages/dsn-parser/tsup.config.mjs index f502ab992..e16f8bf83 100644 --- a/packages/dsn-parser/tsup.config.mjs +++ b/packages/dsn-parser/tsup.config.mjs @@ -5,6 +5,7 @@ export default defineConfig((options) => { return { entry: ['src/index.ts'], splitting: true, + treeshake: true, clean: true, dts: true, format: ['esm', 'cjs'], @@ -14,7 +15,10 @@ export default defineConfig((options) => { }; }, platform: 'browser', - target: ['es2019', ...browserslistToEsbuild()], + minifySyntax: true, + minifyWhitespace: true, + minifyIdentifiers: true, + target: ['es2022', ...browserslistToEsbuild()], tsconfig: './tsconfig.build.json', sourcemap: !options.watch, minify: !options.watch,