Skip to content

Conversation

@rschristian
Copy link
Collaborator

Supersedes #969

@changeset-bot
Copy link

changeset-bot bot commented Jun 4, 2024

🦋 Changeset detected

Latest commit: de49a51

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
microbundle Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Jun 4, 2024

Size Change: 0 B

Total Size: 65.9 kB

ℹ️ View Unchanged
Filename Size
test/fixtures/alias-external/dist/alias-external.esm.mjs 85 B
test/fixtures/alias-external/dist/alias-external.js 80 B
test/fixtures/alias-external/dist/alias-external.umd.js 140 B
test/fixtures/alias/dist/alias-mapping.esm.mjs 62 B
test/fixtures/alias/dist/alias-mapping.js 62 B
test/fixtures/alias/dist/alias-mapping.umd.js 119 B
test/fixtures/async-iife-ts/dist/async-iife-ts.esm.mjs 113 B
test/fixtures/async-iife-ts/dist/async-iife-ts.js 110 B
test/fixtures/async-iife-ts/dist/async-iife-ts.umd.js 160 B
test/fixtures/async-iife-ts/dist/index.d.ts 20 B
test/fixtures/async-ts/dist/async-ts.esm.mjs 158 B
test/fixtures/async-ts/dist/async-ts.js 149 B
test/fixtures/async-ts/dist/async-ts.umd.js 246 B
test/fixtures/async-ts/dist/index.d.ts 78 B
test/fixtures/basic-babelrc/dist/basic-babelrc.esm.mjs 159 B
test/fixtures/basic-babelrc/dist/basic-babelrc.js 156 B
test/fixtures/basic-babelrc/dist/basic-babelrc.umd.js 197 B
test/fixtures/basic-compress-false/dist/basic-compress-false.esm.mjs 303 B
test/fixtures/basic-compress-false/dist/basic-compress-false.js 301 B
test/fixtures/basic-compress-false/dist/basic-compress-false.umd.js 427 B
test/fixtures/basic-css/dist/basic-css.css 107 B
test/fixtures/basic-css/dist/basic-css.esm.mjs 143 B
test/fixtures/basic-css/dist/basic-css.js 139 B
test/fixtures/basic-css/dist/basic-css.umd.js 228 B
test/fixtures/basic-dashed-external/dist/basic-dashed-external.esm.mjs 257 B
test/fixtures/basic-dashed-external/dist/basic-dashed-external.js 311 B
test/fixtures/basic-dashed-external/dist/basic-dashed-external.umd.js 401 B
test/fixtures/basic-flow/dist/basic-lib-flow.esm.mjs 105 B
test/fixtures/basic-flow/dist/basic-lib-flow.js 102 B
test/fixtures/basic-flow/dist/basic-lib-flow.umd.js 205 B
test/fixtures/basic-json/dist/basic-json.esm.mjs 128 B
test/fixtures/basic-json/dist/basic-json.js 125 B
test/fixtures/basic-json/dist/basic-json.umd.js 216 B
test/fixtures/basic-multi-source-css/dist/a.css 98 B
test/fixtures/basic-multi-source-css/dist/a.esm.mjs 134 B
test/fixtures/basic-multi-source-css/dist/a.js 130 B
test/fixtures/basic-multi-source-css/dist/a.umd.js 226 B
test/fixtures/basic-multi-source-css/dist/b.css 96 B
test/fixtures/basic-multi-source-css/dist/b.esm.mjs 135 B
test/fixtures/basic-multi-source-css/dist/b.js 131 B
test/fixtures/basic-multi-source-css/dist/b.umd.js 227 B
test/fixtures/basic-multi-source/dist/a.esm.mjs 78 B
test/fixtures/basic-multi-source/dist/a.js 73 B
test/fixtures/basic-multi-source/dist/a.umd.js 134 B
test/fixtures/basic-multi-source/dist/b.esm.mjs 78 B
test/fixtures/basic-multi-source/dist/b.js 73 B
test/fixtures/basic-multi-source/dist/b.umd.js 134 B
test/fixtures/basic-no-compress/dist/basic-no-compress.esm.mjs 301 B
test/fixtures/basic-no-compress/dist/basic-no-compress.js 299 B
test/fixtures/basic-no-compress/dist/basic-no-compress.umd.js 423 B
test/fixtures/basic-no-pkg-main/dist/basic-no-pkg-main.js 313 B
test/fixtures/basic-node-internals/dist/basic-node-internals.js 234 B
test/fixtures/basic-ts/dist/basic-lib-ts.esm.mjs 157 B
test/fixtures/basic-ts/dist/basic-lib-ts.js 153 B
test/fixtures/basic-ts/dist/basic-lib-ts.umd.js 235 B
test/fixtures/basic-ts/dist/car.d.ts 116 B
test/fixtures/basic-ts/dist/index.d.ts 86 B
test/fixtures/basic-tsx/dist/basic-lib-tsx.esm.mjs 253 B
test/fixtures/basic-tsx/dist/basic-lib-tsx.js 246 B
test/fixtures/basic-tsx/dist/basic-lib-tsx.umd.js 330 B
test/fixtures/basic-tsx/dist/index.d.ts 71 B
test/fixtures/basic-with-cwd/basic/dist/basic.esm.mjs 223 B
test/fixtures/basic-with-cwd/basic/dist/basic.js 219 B
test/fixtures/basic-with-cwd/basic/dist/basic.umd.js 299 B
test/fixtures/basic/dist/basic-lib.esm.mjs 226 B
test/fixtures/basic/dist/basic-lib.js 223 B
test/fixtures/basic/dist/basic-lib.umd.js 305 B
test/fixtures/class-decorators-ts/dist/class-decorators-ts.esm.mjs 390 B
test/fixtures/class-decorators-ts/dist/class-decorators-ts.js 387 B
test/fixtures/class-decorators-ts/dist/class-decorators-ts.umd.js 452 B
test/fixtures/class-decorators-ts/dist/index.d.ts 126 B
test/fixtures/class-properties/dist/class-properties.esm.mjs 139 B
test/fixtures/class-properties/dist/class-properties.js 134 B
test/fixtures/class-properties/dist/class-properties.umd.js 234 B
test/fixtures/css-modules--false/dist/css-modules--false.css 114 B
test/fixtures/css-modules--false/dist/css-modules--false.esm.mjs 52 B
test/fixtures/css-modules--false/dist/css-modules--false.js 49 B
test/fixtures/css-modules--false/dist/css-modules--false.umd.js 156 B
test/fixtures/css-modules--null/dist/css-modules--null.css 118 B
test/fixtures/css-modules--null/dist/css-modules--null.esm.mjs 111 B
test/fixtures/css-modules--null/dist/css-modules--null.js 110 B
test/fixtures/css-modules--null/dist/css-modules--null.umd.js 200 B
test/fixtures/css-modules--string/dist/css-modules--string.css 144 B
test/fixtures/css-modules--string/dist/css-modules--string.esm.mjs 168 B
test/fixtures/css-modules--string/dist/css-modules--string.js 166 B
test/fixtures/css-modules--string/dist/css-modules--string.umd.js 263 B
test/fixtures/css-modules--true/dist/css-modules--true.css 115 B
test/fixtures/css-modules--true/dist/css-modules--true.esm.mjs 141 B
test/fixtures/css-modules--true/dist/css-modules--true.js 139 B
test/fixtures/css-modules--true/dist/css-modules--true.umd.js 230 B
test/fixtures/custom-babelrc/dist/custom-babelrc.esm.mjs 261 B
test/fixtures/custom-babelrc/dist/custom-babelrc.js 254 B
test/fixtures/custom-babelrc/dist/custom-babelrc.umd.js 345 B
test/fixtures/custom-outputs-alt/dist/custom-outputs-alt.cjsmain.js 232 B
test/fixtures/custom-outputs-alt/dist/custom-outputs-alt.esmodule.mjs 158 B
test/fixtures/custom-outputs-alt/dist/custom-outputs-alt.jsnextmain.mjs 236 B
test/fixtures/custom-outputs-alt/dist/custom-outputs-alt.unpkg.js 315 B
test/fixtures/custom-outputs/dist/custom-outputs.exportsx.mjs 154 B
test/fixtures/custom-outputs/dist/custom-outputs.js 225 B
test/fixtures/custom-outputs/dist/custom-outputs.modulex.mjs 231 B
test/fixtures/custom-outputs/dist/custom-outputs.umdx.js 307 B
test/fixtures/custom-source-with-cwd/custom-source/dist/custom-src.esm.mjs 226 B
test/fixtures/custom-source-with-cwd/custom-source/dist/custom-src.js 222 B
test/fixtures/custom-source-with-cwd/custom-source/dist/custom-src.umd.js 304 B
test/fixtures/custom-source/dist/custom-source.esm.mjs 226 B
test/fixtures/custom-source/dist/custom-source.js 222 B
test/fixtures/custom-source/dist/custom-source.umd.js 306 B
test/fixtures/default-named/dist/default-named.esm.mjs 116 B
test/fixtures/default-named/dist/default-named.js 97 B
test/fixtures/default-named/dist/default-named.umd.js 201 B
test/fixtures/define-expression/dist/define-expression.esm.mjs 56 B
test/fixtures/define/dist/define.esm.mjs 55 B
test/fixtures/define/dist/define.js 55 B
test/fixtures/define/dist/define.umd.js 109 B
test/fixtures/esnext-ts/dist/esnext-ts.esm.mjs 1.04 kB
test/fixtures/esnext-ts/dist/esnext-ts.js 1.03 kB
test/fixtures/esnext-ts/dist/esnext-ts.umd.js 1.1 kB
test/fixtures/esnext-ts/dist/index.d.ts 68 B
test/fixtures/inline-source-map/dist/inline-source-map.esm.mjs 759 B
test/fixtures/inline-source-map/dist/inline-source-map.js 753 B
test/fixtures/inline-source-map/dist/inline-source-map.umd.js 841 B
test/fixtures/jsx/dist/jsx.esm.mjs 269 B
test/fixtures/jsx/dist/jsx.js 263 B
test/fixtures/jsx/dist/jsx.umd.js 340 B
test/fixtures/macro/dist/macro-lib.esm.mjs 88 B
test/fixtures/macro/dist/macro-lib.js 84 B
test/fixtures/macro/dist/macro-lib.umd.js 187 B
test/fixtures/mangle-json-file/dist/mangle-json-file.esm.mjs 147 B
test/fixtures/mangle-json-file/dist/mangle-json-file.js 144 B
test/fixtures/mangle-json-file/dist/mangle-json-file.umd.js 235 B
test/fixtures/minify-config-boolean/dist/minify-config-boolean.esm.mjs 160 B
test/fixtures/minify-config-boolean/dist/minify-config-boolean.js 153 B
test/fixtures/minify-config-boolean/dist/minify-config-boolean.umd.js 255 B
test/fixtures/minify-config/dist/minify-config.esm.mjs 141 B
test/fixtures/minify-config/dist/minify-config.js 137 B
test/fixtures/minify-config/dist/minify-config.umd.js 225 B
test/fixtures/minify-path-config/dist/minify-path-config.esm.mjs 149 B
test/fixtures/minify-path-config/dist/minify-path-config.js 146 B
test/fixtures/minify-path-config/dist/minify-path-config.umd.js 237 B
test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/dist/minify-path-parent-dir.esm.mjs 151 B
test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/dist/minify-path-parent-dir.js 148 B
test/fixtures/minify-path-parent-dir-with-cwd/minify-path-parent-dir/dist/minify-path-parent-dir.umd.js 241 B
test/fixtures/modern-generators/dist/modern-generators.esm.mjs 281 B
test/fixtures/modern-generators/dist/modern-generators.js 279 B
test/fixtures/modern-generators/dist/modern-generators.modern.mjs 157 B
test/fixtures/modern-generators/dist/modern-generators.umd.js 359 B
test/fixtures/modern/dist/modern-lib.modern.mjs 152 B
test/fixtures/name-custom-amd/dist/name-custom-amd.esm.mjs 229 B
test/fixtures/name-custom-amd/dist/name-custom-amd.js 225 B
test/fixtures/name-custom-amd/dist/name-custom-amd.umd.js 311 B
test/fixtures/name-custom-cli/dist/name-custom.esm.mjs 226 B
test/fixtures/name-custom-cli/dist/name-custom.js 223 B
test/fixtures/name-custom-cli/dist/name-custom.umd.js 310 B
test/fixtures/no-pkg-name/dist/no-pkg-name.esm.mjs 227 B
test/fixtures/no-pkg-name/dist/no-pkg-name.js 224 B
test/fixtures/no-pkg-name/dist/no-pkg-name.umd.js 308 B
test/fixtures/no-pkg/dist/no-pkg.esm.mjs 224 B
test/fixtures/no-pkg/dist/no-pkg.js 221 B
test/fixtures/no-pkg/dist/no-pkg.umd.js 302 B
test/fixtures/optional-chaining-ts/dist/index.d.ts 108 B
test/fixtures/optional-chaining-ts/dist/optional-chaining-ts.esm.mjs 154 B
test/fixtures/optional-chaining-ts/dist/optional-chaining-ts.js 148 B
test/fixtures/optional-chaining-ts/dist/optional-chaining-ts.umd.js 247 B
test/fixtures/parameters-rest-closure/dist/parameters-rest-closure.esm.mjs 203 B
test/fixtures/parameters-rest-closure/dist/parameters-rest-closure.js 192 B
test/fixtures/parameters-rest-closure/dist/parameters-rest-closure.umd.js 284 B
test/fixtures/pretty/dist/pretty.esm.mjs 6.58 kB
test/fixtures/pretty/dist/pretty.js 6.56 kB
test/fixtures/pretty/dist/pretty.umd.js 6.71 kB
test/fixtures/publish-config/dist/bar.js 87 B
test/fixtures/publish-config/dist/foo.d.ts 60 B
test/fixtures/pure/dist/pure.esm.mjs 108 B
test/fixtures/pure/dist/pure.js 98 B
test/fixtures/pure/dist/pure.umd.js 197 B
test/fixtures/raw/dist/raw.esm.mjs 1.41 kB
test/fixtures/raw/dist/raw.js 1.4 kB
test/fixtures/raw/dist/raw.umd.js 1.52 kB
test/fixtures/shebang/dist/shebang.esm.mjs 125 B
test/fixtures/shebang/dist/shebang.js 118 B
test/fixtures/shebang/dist/shebang.umd.js 216 B
test/fixtures/terser-annotations/dist/terser-annotations.esm.mjs 179 B
test/fixtures/terser-annotations/dist/terser-annotations.js 171 B
test/fixtures/terser-annotations/dist/terser-annotations.umd.js 257 B
test/fixtures/ts-custom-declaration/dist/index.esm.mjs 100 B
test/fixtures/ts-custom-declaration/dist/index.js 89 B
test/fixtures/ts-custom-declaration/dist/index.umd.js 205 B
test/fixtures/ts-declaration/dist/index.esm.mjs 100 B
test/fixtures/ts-declaration/dist/index.js 89 B
test/fixtures/ts-declaration/dist/index.umd.js 201 B
test/fixtures/ts-jsx/dist/index.d.ts 52 B
test/fixtures/ts-jsx/dist/ts-jsx.esm.mjs 163 B
test/fixtures/ts-jsx/dist/ts-jsx.js 158 B
test/fixtures/ts-jsx/dist/ts-jsx.umd.js 251 B
test/fixtures/ts-mixed-exports/dist/car.d.ts 116 B
test/fixtures/ts-mixed-exports/dist/index.d.ts 92 B
test/fixtures/ts-mixed-exports/dist/ts-mixed-exports.esm.mjs 168 B
test/fixtures/ts-mixed-exports/dist/ts-mixed-exports.js 160 B
test/fixtures/ts-mixed-exports/dist/ts-mixed-exports.umd.js 261 B
test/fixtures/ts-module/dist/foo.d.ts 60 B
test/fixtures/ts-module/dist/index.d.ts 63 B
test/fixtures/ts-module/dist/ts-module.esm.mjs 108 B
test/fixtures/ts-module/dist/ts-module.js 97 B
test/fixtures/ts-module/dist/ts-module.umd.js 197 B
test/fixtures/visualizer/dist/visualizer.esm.mjs 119 B
test/fixtures/visualizer/dist/visualizer.js 177 B
test/fixtures/visualizer/dist/visualizer.umd.js 259 B
test/fixtures/worker-loader/dist/worker-35b22e56.js 125 B
test/fixtures/worker-loader/dist/worker-7e1b9921.js 107 B
test/fixtures/worker-loader/dist/worker-loader.esm.mjs 181 B
test/fixtures/worker-loader/dist/worker-loader.modern.mjs 174 B

compressed-size-action

@@ -1,5 +1,6 @@
{
"compilerOptions": {
"moduleResolution": "node",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

tslib otherwise can't be found, oddly. This should be the default but maybe rtp2 is doing something odd.

@rschristian rschristian changed the title chore: Bump deps, mostly working chore: Bump (most) deps Jun 4, 2024
@rschristian rschristian marked this pull request as ready for review June 4, 2024 07:31
@rschristian rschristian mentioned this pull request Jun 4, 2024
@rschristian rschristian linked an issue Jul 3, 2024 that may be closed by this pull request
@hbroer
Copy link

hbroer commented Dec 20, 2024

This is IMO very important to merge. I need to manualy override "rollup-plugin-typescript2" to latest (0.36.0) everywhere I use microbundle, else it can't compile typescript because it can't find the types:

(rpt2 plugin) Error: ...ts(x,x): semantic error TS2307: Cannot find module '...' or its corresponding type declarations.
  There are types at '....d.ts',  but this result could not be resolved under your current 'moduleResolution' setting. Consider updating to 'node16', 'nodenext', or 'bundler'.

I had the solution found a year or so ago, but forgot about it and did get cought by it again and wasted a few hours to find out how to solve it. Workaround:

Add this to your package.json

  "overrides": {
    "rollup-plugin-typescript2": "^0.36.0"
  }

If you use npm workspaces make sure it is overwritten and not existing anymore in node_modules/microbundle/node_modules.

@rschristian
Copy link
Collaborator Author

@developit If you have a few minutes, would appreciate a peek at this and potentially #1082 & #1083 -- we're starting to hit dep rot

@@ -2320,26 +2319,26 @@ modern-generators


Build \\"modern-generators\\" to dist:
248 B: modern-generators.js.gz
201 B: modern-generators.js.br
2.57 kB: modern-generators.js.gz
Copy link
Collaborator

Choose a reason for hiding this comment

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

Are we ok with this massive increase?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hey, long time no see! Hope all is well & good w/ you.

Mentioned this above in a resolved comment:

Oh nice, 7.18.0 ended up inlining regenerator as a normal helper, dropping the global: babel/babel#14538

This is a sizable increase but IMO it's completely reasonable.

I still think this is reasonable, but admittedly, I was very much not a fan of Babel's previous behavior.

Do you disagree with this? I suppose we could work around it and revert to previous behavior if we really needed to.

Copy link
Collaborator

Choose a reason for hiding this comment

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

All good, how about you?

So if I'm understanding it correctly, the previous size was somewhat misleading because the runtime was needed?
But now that it's inlined it will be duplicated for each library built this way

Maybe @developit could give his opinion

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not bad, thanks!

You're right, yep. regeneratorRuntime was a unique case in that instead of being inlined, as every other Babel helper is, it was consumed as a global with the expectation that the user makes it available. This tripped up a great many users over the years (Preact org issues, for reference, and you can find many hundred similar issues elsewhere) as it was a bit odd and had questionable DX.

Indeed though, like all Babel helpers this can end up duplicated and it's particularly bad if it is -- even gzip isn't going to save you there.

That being said, I'm not sure there's a whole heck of a lot that we can do, or nothing comes to mind at least. If a user is bundling their deps with Microbundle, and one of those deps has this helper inlined, there's still duplication whether we stick with the old global or duplicate it. In a perfect world every module would be distributing modern bundles with minimal transpiling/helpers, but... :/ Heck, even our "modern" is still ES2017, could probably do with a bump to 2019-2020?

Copy link
Owner

Choose a reason for hiding this comment

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

I am wondering why the modern output has regenerator in it at all, since ES2017 supports generators.

Maybe we need to configure Babel "assumptions"?

Copy link
Collaborator Author

@rschristian rschristian Jan 7, 2025

Choose a reason for hiding this comment

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

This is perhaps a poorly named test case: modern-generators is the package name, which forms the output file name. modern-generators.modern.js is the modern output, and it's unchanged.

Caught me off guard once or twice too, could rename it to just generators I suppose.

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.

Types haven't been bundled by microbundle

5 participants