analogjs / analog

The fullstack meta-framework for Angular. Powered by Vite and Nitro
https://analogjs.org
MIT License
2.48k stars 234 forks source link

`@analogjs/vite-plugin-angular/setup-vitest` pull zone.js #1140

Closed JeanMeche closed 2 months ago

JeanMeche commented 2 months ago

Which scope/s are relevant/related to the feature request?

vite-plugin-angular

Information

I wanted to test zoneless + vitest with this small demo written by @yjaaidi but @analogjs/vite-plugin-angular/setup-vitest pull zone.js without any opt-out possibility.

https://stackblitz.com/edit/angular-vitest-starter-v18-ryiakv?file=vite.config.ts,src%2Ftest-setup.ts

Describe any alternatives/workarounds you're currently using

No response

I would be willing to submit a PR to fix this issue

brandonroberts commented 2 months ago

If you don't need zone.js, just don't include the import in the src/test-setup.ts as everything there is related to it.

brandonroberts commented 2 months ago

In the @analogjs/vitest-angular package, its renamed to @analogjs/vitest-angular/setup-zone, so its more clear that you don't need it if you aren't using zone.js

JeanMeche commented 2 months ago

Makes perfect sense, thank you for the input.

yjaaidi commented 2 months ago

I just updated the Stackblitz to 18.0.1 and commented out the import to avoid the warning and to let people opt-in to zonejs. https://stackblitz.com/edit/angular-vitest-starter-v18

brandonroberts commented 2 months ago

I just updated the Stackblitz to 18.0.1 and commented out the import to avoid the warning and to let people opt-in to zonejs. https://stackblitz.com/edit/angular-vitest-starter-v18

Thanks! We could add this starter template to our docs also if you agree. I think it would be zoneful by default though

yjaaidi commented 2 months ago

That would be amazing! I just made it zoneful: https://stackblitz.com/edit/angular-vitest-starter-v18 and moved the zoneless version here: https://stackblitz.com/edit/angular-vitest-starter-v18-zoneless I'll be maintaining the templates so please let me know if I miss an update 😉