sst / open-next

Open source Next.js serverless adapter
https://open-next.js.org
MIT License
3.7k stars 111 forks source link

Next 14.1.1 Image Optimization Breaking Changes #374

Closed khuezy closed 4 months ago

khuezy commented 4 months ago

Open-Next Image Optimization Code

New nextjs code

chungweileong94 commented 4 months ago

As of now, I patched the image optimization adapter manually as a workaround. open-next@2.3.5.patch

khuezy commented 4 months ago

@chungweileong94 would you mind putting up a PR for that?

chungweileong94 commented 4 months ago

@chungweileong94 would you mind putting up a PR for that?

I would love to, but that will means that the minimum NextJS has to be 14.1.1 tho, any idea how to handle backward compatibility?

chungweileong94 commented 4 months ago

I mean like is there any existing version specific code that already exists in the codebase?

khuezy commented 4 months ago

We have a very hacky plugin system that replacing code during the prebuild time. See: https://github.com/sst/open-next/blob/main/packages/open-next/src/adapters/plugins/14.1/util.ts

For the individual files, we do this:https://open-next.js.org/inner_workings/plugin

chungweileong94 commented 4 months ago

We have a very hacky plugin system that replacing code during the prebuild time. See: https://github.com/sst/open-next/blob/main/packages/open-next/src/adapters/plugins/14.1/util.ts

Ah I see, will take a look at that, thx for the info!