Closed kytta closed 11 months ago
Things I'm stuck on at the moment (just to keep records):
require
into import
doesn't work for something more complicated, like ESBuild and webpack plugins. I haven't figured out the whole errors yet.Also:
jest.setTimeout(15000)
; we have to set a timeout for every it()
call or for every test per run via a config file, but not per test file. Instead of plastering it on every test, I only apply it to the ones that actually need more timeVitest doesn't have a plausible alternative to jest.setTimeout(15000); we have to set a timeout for every it() call or for every test per run via a config file, but not per test file. Instead of plastering it on every test, I only apply it to the ones that actually need more time
Try to remove it. Maybe we don’t need it anymore (by increasing performance with new Node.js and esbuild).
Rewriting require into import doesn't work for something more complicated, like ESBuild and webpack plugins. I haven't figured out the whole errors yet.
Need some example to understand what exactly problems do you have
When the plugins do work, they tend to provide different size results. For example, files compressed with ESBuild tend to be bigger than before, but I haven't figured out why yet. I've tried converting test files into both ESM and CJS, but none worked as expected. As such, snapshot tests fail
If it is only a few bytes, it could happen just because of dependencies update (new esbuild compress a little different). Just updates tests and snapshots.
Alright, this is mostly done now, only couple of bugs left.
Rewriting require into import doesn't work for something more complicated, like ESBuild and webpack plugins. I haven't figured out the whole errors yet.
Need some example to understand what exactly problems do you have
Currently stuck on webpack-css
with the following:
AssertionError: expected 70 to be greater than 1450
❯ packages/webpack-css/test/index.test.js:41:33
39| }
40| await run(config)
41| expect(config.checks[0].size).toBeGreaterThan(1450)
| ^
42| expect(config.checks[0].size).toBeLessThan(2400)
43| })
Seems like the non-JS requires inside nonjs.js
get completely ignored, as the file size stays the same. I wonder if it's because I still require()
them instead of using dynamic imports — haven't had time to test this out yet.
When the plugins do work, they tend to provide different size results.
If it is only a few bytes, it could happen just because of dependencies update (new esbuild compress a little different). Just updates tests and snapshots.
For the "supports ignore" test on esbuild, it doesn't seem to, well, support ignore
, as the bundle size is way bigger than expected
AssertionError: expected 70 to be greater than 1450
70 bytes is nothing. Just update the size.
For the "supports ignore" test on esbuild, it doesn't seem to, well, support ignore, as the bundle size is way bigger than expected
This is more important bug. But with the current data I can’t give you any advice rather than keep debuging.
AssertionError: expected 70 to be greater than 1450
70 bytes is nothing. Just update the size.
How so? It is expected that the final webpack bundle is in the 1450–2400 range, but it's just 70 (which coincidentally matches the size of the unbundled file), so 2–3 orders of magnitude smaller.
It is expected that the final webpack bundle is in the 1450–2400 range, but it's just 70
Got it! Yes, it is not expected (I thought that it is 70 less, not equal to 70).
Closing for https://github.com/ai/size-limit/pull/338
231405 bytes)test/get-running-time.test.js > calculates running time
doesn't run on my machine, both Jest and Vitest145070 bytes)