Skip to content

Use MD5 hash for LQIP class name generation#2446

Open
jaroel wants to merge 12 commits into
simonihmig:mainfrom
jaroel:patch-1
Open

Use MD5 hash for LQIP class name generation#2446
jaroel wants to merge 12 commits into
simonihmig:mainfrom
jaroel:patch-1

Conversation

@jaroel

@jaroel jaroel commented May 27, 2026

Copy link
Copy Markdown

Fixes #2441

@changeset-bot

changeset-bot Bot commented May 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 625eff5

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

This PR includes changesets to release 1 package
Name Type
@responsive-image/build-utils Patch

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

@simonihmig simonihmig left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for working on this!

Code looks good, but there are some CI failures to fix:

  • a weird eslint error, but seems related to import order
  • some test expectations here
  • also found some vitest snapshots in the vite-plugin and webpack packages' tests referring to ri-dyn-* classes which likely need to be updated

You can run the test suites of a package by calling pnpm turbo test.vitest inside the package folder. Let me know if you need help fixing those!

@jaroel

jaroel commented May 29, 2026

Copy link
Copy Markdown
Author

@simonihmig Things should work better now.

That getTokensOrCommentsAfter traceback is tracked here import-js/eslint-plugin-import#3227

@simonihmig

Copy link
Copy Markdown
Owner

@jaroel thanks for updating the PR! After running CI again, some of the class names in the vitest snapshots are not matching the expected ones. I wonder, are the tests passing locally for you? Or do we have an "environment issue" maybe, that the hashes generated on one machine (your local one) don't match the ones on another machine (GH CI runners)?

@jaroel

jaroel commented Jun 1, 2026

Copy link
Copy Markdown
Author

@simonihmig Using hex digest should be more stable across machines :)

@jaroel

jaroel commented Jun 7, 2026

Copy link
Copy Markdown
Author

@simonihmig It would be great if you could try to run them tests locally on your machine.

There's something really weird going on where I can't run some webpack tests related to

expect(stats.modules![0]?.modules).toHaveLength(2);
failing with AssertionError: Target cannot be null or undefined..

@simonihmig

Copy link
Copy Markdown
Owner

There's something really weird going on where I can't run some webpack tests

I was able to reproduce, but also on main branch! So those are not related to your PR. Seems something is wrong with the (turborepo) setup, likely those tests didn't even run in CI since the regression was introduced. 🙈

I'll need to investigate this!

For your PR, I still see some snapshot mismatches in the vite tests, both in CI and locally. Do the test pass for you locally?

@sonarqubecloud

sonarqubecloud Bot commented Jun 7, 2026

Copy link
Copy Markdown

@jaroel

jaroel commented Jun 7, 2026

Copy link
Copy Markdown
Author

@simonihmig Yep, locally they work just fine.
The resource we're hashing is on my machine /Users/roel/Develop/responsive-image/packages/vite-plugin/tests/fixtures/image.jpg, so that's something.

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.

generateLqipClassName uses global counter → LQIP class name mismatch between SSR and client builds

2 participants