Skip to content

[image-optimizer] Refactor into lightweight transform module - #97988

Open
styfle wants to merge 2 commits into
vercel:canaryfrom
styfle:styfle/imgopt-lightweight-transform
Open

[image-optimizer] Refactor into lightweight transform module#97988
styfle wants to merge 2 commits into
vercel:canaryfrom
styfle:styfle/imgopt-lightweight-transform

Conversation

@styfle

@styfle styfle commented Aug 27, 2026

Copy link
Copy Markdown
Member

This PR is strictly a refactor, no logic should change.

The idea is that we eventually want to run the image optimizer transform step in a child process. This PR refactors the code to make a new transform.ts that is lightweight and should reduce some of the overhead of loading a large module graph when spawning a new process.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Failing test suites

Commit: e2635d8 | About building and testing Next.js

pnpm test-dev test/e2e/app-dir/actions/app-action-node-middleware.test.ts (job)

  • app-dir action handling > HMR > should support updating the action (DD)
Expand output

● app-dir action handling › HMR › should support updating the action

expect(received).toBeGreaterThan(expected)

Expected: > 1000
Received:   0

  1052 |             await browser.elementByCss('#inc').click()
  1053 |             const val = Number(await browser.elementById('count').text())
> 1054 |             expect(val).toBeGreaterThan(1000)
       |                         ^
  1055 |           })
  1056 |         } finally {
  1057 |           await next.patchFile(filePath, origContent)

  at toBeGreaterThan (e2e/app-dir/actions/app-action.test.ts:1054:25)
  at retry (lib/next-test-utils.ts:871:14)
  at Object.<anonymous> (e2e/app-dir/actions/app-action.test.ts:1051:11)

@styfle
styfle force-pushed the styfle/imgopt-lightweight-transform branch from c2eb1ef to dc4abd0 Compare August 28, 2026 03:01
@styfle
styfle requested a review from eps1lon August 28, 2026 03:04
@styfle
styfle marked this pull request as ready for review August 28, 2026 03:04
@styfle
styfle force-pushed the styfle/imgopt-lightweight-transform branch from dc4abd0 to 35984cc Compare August 28, 2026 03:31
@styfle styfle changed the title [image-optimizer] Extract lightweight transform runtime [image-optimizer] Refactor into lightweight transform module Aug 28, 2026
@styfle
styfle force-pushed the styfle/imgopt-lightweight-transform branch from 35984cc to ca52aa6 Compare August 28, 2026 04:19
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.

1 participant