marvinhagemeister / karma-esbuild

Preprocessor based on esbuild for the karma test runner
MIT License
21 stars 10 forks source link

Add suport for esbuild 0.17 #55

Closed handerss-spotfire closed 1 year ago

handerss-spotfire commented 1 year ago

This PR adds support for esbuild 0.17 by switching from the removed APIs to the new ones. I have also updated the peerDependencies and devDependencies to reflect this.

After making the appropriate changes 3 tests failed. I believe these fails may simply be due to changes in esbuild so I have tweaked the tests to make them pass, but please take a closer look. In particular the failing tests seem to be related to sourcemaps:

Fixes: https://github.com/marvinhagemeister/karma-esbuild/issues/54

handerss-spotfire commented 1 year ago

The Ubuntu check failed due to some account limit. Guess this is unrelated to the PR?

error /home/runner/work/karma-esbuild/karma-esbuild/node_modules/sharp: Command failed.
Exit code: 1
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments: 
Directory: /home/runner/work/karma-esbuild/karma-esbuild/node_modules/sharp
Output:
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.5/libvips-8.10.5-linux-x64.tar.br
ERR! sharp Status 503 Egress is over the account limit.
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/install for required dependencies
jridgewell commented 1 year ago

As a follow up, I think we can greatly simplify bundle.ts now that esbuild has the context API. A lot of the code we built up because we couldn't stop an in-progress build, and we couldn't be guaranteed the first build would return a proper BuildResult to issues rebuilds on. Both are solved with context.

handerss-spotfire commented 1 year ago

@jridgewell Sounds good, I just did the minimal amount of work to get it running.

jridgewell commented 1 year ago

Ping @marvinhagemeister to merge and release

romanc commented 1 year ago

@jridgewell / @marvinhagemeister any plans to merge this PR soon? Esbuild is moving quite fast and I would like to keep up with it. I'm thinking of creating a fork just to get this PR merged and get myself unblocked from updating eslint. I'm happy to do so, just want to make sure it's worth the "effort". If you guys plan to merge soon, I wouldn't need to do that.

objerke commented 1 year ago

@marvinhagemeister Any chance of this being merged? It would be a great improvement as this tool holds back usage of newer versions of esbuild and its new TypeScript/CSS bundling features.

anthony-redFox commented 1 year ago

Happy Friday - new fork https://www.npmjs.com/package/karma-esbuild-up

https://github.com/Second-Live/karma-esbuild-up

angrycat9000 commented 1 year ago

Thanks for merging this @jridgewell . Any plans for a release with this fix?

romanc commented 1 year ago

FYI https://github.com/karma-runner/karma#karma-is-deprecated-and-is-not-accepting-new-features-or-general-bug-fixes

Bnaya commented 1 year ago

Any plans for release it? :)

angrycat9000 commented 1 year ago

bump @marvinhagemeister any plans to release an update with this? Would be greatly appreciated. Thanks

gecugamo commented 1 year ago

@jridgewell @marvinhagemeister hello - is this project still maintained? Looks like there are a couple forks out there that have released the esbuild 0.17 fix, but would prefer to use this package for clear documentation. Any chance we can release an update with the esbuild 0.17 changes?