Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[testing] More testing #104

Merged
merged 62 commits into from
Oct 23, 2024
Merged

[testing] More testing #104

merged 62 commits into from
Oct 23, 2024

Conversation

yoannmoinet
Copy link
Member

@yoannmoinet yoannmoinet commented Oct 9, 2024

What and why?

We need more tests over the whole ecosystem, to confirm we ship something that is working as expected, and not realise something's broken after it's been shipped.

How?

This PR adds a lot of tests, doing so, it also revealed some major bugs, especially around the injection plugin.
I had to fix those as well.

  • Minor linting updates.
  • Minor local dev scripts updates, factorising some scripts using yarn loop.
  • Add a bunch of helpers for the injection plugin.
  • Completely change how we do injection with esbuild:
    • We used to inject through the inject config point, mutating the configuration for the whole list of plugins (client side). This had the effect of breaking every sub builds, because they were re-using the configuration (with the new inject config) but changing the plugins, thus removing our resolver and breaking the resolution of our injected file.
  • Completely refactored the build-report for webpack.
    • Webpack is obfuscating a lot of modules when you get them from stats (it concatenate them without giving you more information). So I've built a special plugin to create a more robust and more precise dependency graph.
  • Fix the other build reports following the new injection process.
  • Fix the internal plugin names.
  • Factorise the usage of doRequest in the telemetry plugin.
  • Some minor jest updates, helpers, configs, mocks...
  • New --no-cleanup flag for jest, so it keeps the built files.
  • Update how we run and handle errors for our runBundlers helper.
  • Add tests, a lot.
    • Especially for the build and verify that what we ship actually works IRL.
    • Also add a warning when we run this test with an outdated build.
    • I had to do some wizardry around how we test for webpack4 and webpack5.
  • Copy files that are necessary to unplugin to work with their custom loaders.

@yoannmoinet yoannmoinet marked this pull request as ready for review October 18, 2024 14:11
@yoannmoinet yoannmoinet requested a review from a team as a code owner October 18, 2024 14:11
@yoannmoinet yoannmoinet requested review from elbywan and removed request for a team October 18, 2024 14:11
packages/core/src/helpers.ts Show resolved Hide resolved
packages/core/src/plugins/injection/index.ts Outdated Show resolved Hide resolved
packages/core/src/plugins/injection/index.ts Show resolved Hide resolved
packages/webpack-plugin/package.json Outdated Show resolved Hide resolved
@yoannmoinet yoannmoinet merged commit 8aa9755 into master Oct 23, 2024
5 checks passed
@yoannmoinet yoannmoinet deleted the yoann/more-testing branch October 23, 2024 12:33
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.

2 participants