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

feat(cloudflare): support "compile-time" only image config for astro:assets #58

Conversation

alexanderniebuhr
Copy link
Member

@alexanderniebuhr alexanderniebuhr commented Nov 10, 2023

Current state:

  • works with npm
  • works with pnpm + nodelinker:hoisted
  • doens't work with bun
  • doesn't work with pnpm + nodelinker:isolated

Use the hoisted installation mode, where all dependencies and their transitive dependencies are installed as high up in the node_modules tree as possible.
This can potentially mean that packages have access to dependencies they did not specify in their package.json, but it might be useful for compatibility.
By default, dependencies are installed in "isolated" mode, using a symlink/junction structure to simulate a dependency tree.

Given the explanation and looking at which packageManagers work, it has to be some kind of transitive dependency resolving issue, but I'm very confused why that would break bundling

Changes

Copy link

changeset-bot bot commented Nov 10, 2023

🦋 Changeset detected

Latest commit: 7050491

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

This PR includes changesets to release 15 packages
Name Type
@astrojs/cloudflare Minor
@test/astro-cloudflare-dev-runtime-pages Patch
@test/astro-cloudflare-dev-runtime-workers Patch
@test/astro-cloudflare-directory-mode Patch
@test/astro-cloudflare-external-image-service Patch
@test/astro-cloudflare-function-per-route Patch
@test/astro-cloudflare-hybrid Patch
@test/astro-cloudflare-no-output Patch
@test/astro-cloudflare-prerender Patch
@test/astro-cloudflare-routes-json Patch
@test/astro-cloudflare-wasm-function-per-route Patch
@test/astro-cloudflare-wasm-directory Patch
@test/astro-cloudflare-wasm Patch
@test/astro-cloudflare-with-solid-js Patch
@test/astro-cloudflare-wrangler-runtime 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

@alexanderniebuhr
Copy link
Member Author

alexanderniebuhr commented Nov 10, 2023

@alexanderniebuhr
Copy link
Member Author

!preview cf-assets-compile

Copy link
Contributor

Snapshots have been released for the following packages:

  • @astrojs/cloudflare@experimental--cf-assets-compile
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--cf-assets-compile tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info @astrojs/cloudflare
🦋  info npm info @astrojs/netlify
🦋  info @astrojs/cloudflare is being published because our local version (0.0.0-cf-assets-compile-20231110081053) has not been published on npm
🦋  warn @astrojs/netlify is not being published because version 3.0.4 is already published on npm
🦋  info Publishing "@astrojs/cloudflare" at "0.0.0-cf-assets-compile-20231110081053"
🦋  success packages published successfully:
🦋  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110081053
🦋  Creating git tag...
🦋  New tag:  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110081053
Build Log

> root@0.0.0 build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"

• Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils
• Running build in 3 packages
• Remote caching disabled
::group::@astrojs/netlify:build
cache miss, executing 25e4003f98a2ceda

> @astrojs/netlify@3.0.4 build /home/runner/work/adapters/adapters/packages/netlify
> tsc

::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing 1d9d9d1e0e214a85

> @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110081053 build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc

::endgroup::

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    3.608s 

@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch from ddd6880 to 00f577f Compare November 10, 2023 08:20
@alexanderniebuhr
Copy link
Member Author

!preview cf-assets-compile

Copy link
Contributor

Snapshots have been released for the following packages:

  • @astrojs/cloudflare@experimental--cf-assets-compile
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--cf-assets-compile tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info @astrojs/cloudflare
🦋  info npm info @astrojs/netlify
🦋  info @astrojs/cloudflare is being published because our local version (0.0.0-cf-assets-compile-20231110082059) has not been published on npm
🦋  warn @astrojs/netlify is not being published because version 3.0.4 is already published on npm
🦋  info Publishing "@astrojs/cloudflare" at "0.0.0-cf-assets-compile-20231110082059"
🦋  success packages published successfully:
🦋  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110082059
🦋  Creating git tag...
🦋  New tag:  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110082059
Build Log

> root@0.0.0 build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"

• Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils
• Running build in 3 packages
• Remote caching disabled
::group::@astrojs/netlify:build
cache miss, executing 25e4003f98a2ceda

> @astrojs/netlify@3.0.4 build /home/runner/work/adapters/adapters/packages/netlify
> tsc

::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing 84742be1c86ab8cd

> @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110082059 build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc

::endgroup::

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    3.604s 

@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch from 00f577f to c9ceb14 Compare November 10, 2023 08:28
@alexanderniebuhr
Copy link
Member Author

!preview cf-assets-compile

Copy link
Contributor

Snapshots have been released for the following packages:

  • @astrojs/cloudflare@experimental--cf-assets-compile
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--cf-assets-compile tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info @astrojs/cloudflare
🦋  info npm info @astrojs/netlify
🦋  info @astrojs/cloudflare is being published because our local version (0.0.0-cf-assets-compile-20231110082901) has not been published on npm
🦋  warn @astrojs/netlify is not being published because version 3.0.4 is already published on npm
🦋  info Publishing "@astrojs/cloudflare" at "0.0.0-cf-assets-compile-20231110082901"
🦋  success packages published successfully:
🦋  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110082901
🦋  Creating git tag...
🦋  New tag:  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110082901
Build Log

> root@0.0.0 build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"

• Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils
• Running build in 3 packages
• Remote caching disabled
::group::@astrojs/netlify:build
cache miss, executing 25e4003f98a2ceda

> @astrojs/netlify@3.0.4 build /home/runner/work/adapters/adapters/packages/netlify
> tsc

::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing 2bc903f05182b4b6

> @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110082901 build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc

::endgroup::

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    3.569s 

@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch 2 times, most recently from 15394fe to 1118d2e Compare November 10, 2023 08:31
@alexanderniebuhr
Copy link
Member Author

!preview cf-assets-compile

Copy link
Contributor

Snapshots have been released for the following packages:

  • @astrojs/cloudflare@experimental--cf-assets-compile
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--cf-assets-compile tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info @astrojs/cloudflare
🦋  info npm info @astrojs/netlify
🦋  info @astrojs/cloudflare is being published because our local version (0.0.0-cf-assets-compile-20231110083141) has not been published on npm
🦋  warn @astrojs/netlify is not being published because version 3.0.4 is already published on npm
🦋  info Publishing "@astrojs/cloudflare" at "0.0.0-cf-assets-compile-20231110083141"
🦋  success packages published successfully:
🦋  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110083141
🦋  Creating git tag...
🦋  New tag:  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110083141
Build Log

> root@0.0.0 build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"

• Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils
• Running build in 3 packages
• Remote caching disabled
::group::@astrojs/netlify:build
cache miss, executing 25e4003f98a2ceda

> @astrojs/netlify@3.0.4 build /home/runner/work/adapters/adapters/packages/netlify
> tsc

::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing f645cb70f0d9a2f1

> @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110083141 build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc

::endgroup::

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    3.675s 

@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch from 1118d2e to 5eaf9c8 Compare November 10, 2023 08:58
@alexanderniebuhr
Copy link
Member Author

!preview cf-assets-compile

Copy link
Contributor

Snapshots have been released for the following packages:

  • @astrojs/cloudflare@experimental--cf-assets-compile
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--cf-assets-compile tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info @astrojs/cloudflare
🦋  info npm info @astrojs/netlify
🦋  info @astrojs/cloudflare is being published because our local version (0.0.0-cf-assets-compile-20231110114527) has not been published on npm
🦋  warn @astrojs/netlify is not being published because version 3.0.4 is already published on npm
🦋  info Publishing "@astrojs/cloudflare" at "0.0.0-cf-assets-compile-20231110114527"
🦋  success packages published successfully:
🦋  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110114527
🦋  Creating git tag...
🦋  New tag:  @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110114527
Build Log

> root@0.0.0 build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"

• Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils
• Running build in 3 packages
• Remote caching disabled
::group::@astrojs/netlify:build
cache miss, executing 25e4003f98a2ceda

> @astrojs/netlify@3.0.4 build /home/runner/work/adapters/adapters/packages/netlify
> tsc

::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing 5f8af39013111d48

> @astrojs/cloudflare@0.0.0-cf-assets-compile-20231110114527 build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc

::endgroup::

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    3.768s 

@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/add_external_image_service_for_cloudflare branch from 58cc3f3 to 99cf387 Compare November 10, 2023 18:18
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch from 5eaf9c8 to 86909f9 Compare November 12, 2023 06:58
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/add_external_image_service_for_cloudflare branch from 99cf387 to 4587fea Compare November 13, 2023 16:31
Base automatically changed from nbhr/add_external_image_service_for_cloudflare to main November 13, 2023 18:07
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch from 86909f9 to 3ef4af5 Compare November 13, 2023 18:08
@alexanderniebuhr alexanderniebuhr marked this pull request as draft November 14, 2023 20:06
@RodrigoTomeES
Copy link

RodrigoTomeES commented Nov 15, 2023

Hi! @alexanderniebuhr, I am developing a website (is SSR hybrid, basically all is static except an API) that need this use of case so if you need I can test the packages. For know I am install @astrojs/cloudflare@experimental--cf-assets-compile and I am looking how can I activate the "compile-time" optimization.

EDIT: I saw that it the "compile" option and I am testing it.
EDIT 2: I found and issue with compile optimization, if I use Picture component it generate the fallback image as PNG instead the follow the original format, so if it was a jpg the fallback will have a bigger size:

  ▶ /_astro/me.ee1ae41e_ZcCgWD.webp (reused cache entry) (+1ms) (1/31)
  ▶ /_astro/50241495487_e05f382b64_o_1hx8eF.webp (reused cache entry) (+1.12s) (2/31)
  ▶ /_astro/50241495487_e05f382b64_o_Z2duqmk.webp (reused cache entry) (+1.11s) (3/31)
  ▶ /_astro/50241495487_e05f382b64_o_1QWdIk.webp (reused cache entry) (+1.11s) (4/31)
  ▶ /_astro/50241495487_e05f382b64_o_1BJQAq.png (reused cache entry) (+1.13s) (5/31)
  ▶ /_astro/50241495487_e05f382b64_o_1hktIV.png (reused cache entry) (+1.05s) (6/31)
  ▶ /_astro/50241495487_e05f382b64_o_hA00E.png (reused cache entry) (+750ms) (7/31)
  ▶ /_astro/42003419460_f9109b0fba_o_Z128QwJ.webp (reused cache entry) (+682ms) (8/31)
  ▶ /_astro/42003419460_f9109b0fba_o_Z2i4Hkw.webp (reused cache entry) (+680ms) (9/31)
  ▶ /_astro/42003419460_f9109b0fba_o_1KMJx0.webp (reused cache entry) (+674ms) (10/31)
  ▶ /_astro/42003419460_f9109b0fba_o_Z2jRW5I.png (reused cache entry) (+684ms) (11/31)
  ▶ /_astro/42003419460_f9109b0fba_o_1MkzM2.png (reused cache entry) (+629ms) (12/31)
  ▶ /_astro/42003419460_f9109b0fba_o_L0SPC.png (reused cache entry) (+417ms) (13/31)
  ▶ /_astro/52298257522_fe30274bb7_o_Z1V7LNy.webp (reused cache entry) (+0.99s) (14/31)
  ▶ /_astro/52298257522_fe30274bb7_o_ZlXcAC.webp (reused cache entry) (+0.98s) (15/31)
  ▶ /_astro/52298257522_fe30274bb7_o_Z1lHGjT.webp (reused cache entry) (+0.96s) (16/31)
  ▶ /_astro/52945559280_54640422ce_o_ZGKrG2.webp (reused cache entry) (+1.93s) (17/31)
  ▶ /_astro/52945559280_54640422ce_o_HTWcN.webp (reused cache entry) (+1.96s) (18/31)
  ▶ /_astro/53175451734_805a2501ae_o_1eA9N8.webp (reused cache entry) (+0.84s) (19/31)
  ▶ /_astro/53175451734_805a2501ae_o_Z2groMR.webp (reused cache entry) (+0.84s) (20/31)
  ▶ /_astro/53175451734_805a2501ae_o_1O0fhM.webp (reused cache entry) (+0.83s) (21/31)
  ▶ /_astro/52945559280_54640422ce_o_Z4keik.webp (reused cache entry) (+1.95s) (22/31)
  ▶ /_astro/52298257522_fe30274bb7_o_Z1AU3rN.png (reused cache entry) (+2.95s) (23/31)
  ▶ /_astro/53175451734_805a2501ae_o_1yMS9S.png (reused cache entry) (+0.87s) (24/31)
  ▶ /_astro/52945559280_54640422ce_o_ZmxIkh.png (reused cache entry) (+2.07s) (25/31)
  ▶ /_astro/53175451734_805a2501ae_o_1envio.png (reused cache entry) (+0.87s) (26/31)
  ▶ /_astro/52298257522_fe30274bb7_o_Z1Vkqji.png (reused cache entry) (+2.96s) (27/31)
  ▶ /_astro/52945559280_54640422ce_o_ZQrguR.png (reused cache entry) (+2.03s) (28/31)
  ▶ /_astro/53175451734_805a2501ae_o_eD1z7.png (reused cache entry) (+0.89s) (29/31)
  ▶ /_astro/52298257522_fe30274bb7_o_297dLm.png (reused cache entry) (+2.91s) (30/31)
  ▶ /_astro/52945559280_54640422ce_o_Z1DGs10.png (reused cache entry) (+1.82s) (31/31)

EDIT 3: I think all work well in cloudflare, but I couldn't deploy because I exceed the 26MB limit for free tier

rodrigotomees.932bdc84-0961-41ea-aa00-acddbd6e77a2.log

EDIT 4: Compiled and deployed successfully using Image instead of Picture
rodrigotomees.47afd97d-08b8-470a-ba03-daad338d0cd8.log

The deployment is here: rodrigotome.es

@alexanderniebuhr
Copy link
Member Author

@RodrigoTomeES thank you for testing this. I'll just have to add a test case for this PR and it is ready to merge. Probably later this week.

:re the fallback format for Picture component, I remember that it should been fixed in this PR. Maybe double check and if not open a new Issue in the main repo with your findings :)

@mikkelsvartveit
Copy link

I have an Astro site hosted on Cloudflare Pages, and would like to enable SSR for certain pages. However, once I switch to the Cloudflare adapter, all image optimizations stop working, even for prerendered routes. Am I reading correctly that this PR will fix this, so that build-time image optimizations will work?

If so, is there any news on this? I'm happy to help with testing here

@alexanderniebuhr
Copy link
Member Author

@mikkelsvartveit That's correct. This should work with npm, but we experienced some bundling issues with other package managers. I'll update the branch and generate a new preview release.

@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch from 583e8b6 to d30a95e Compare January 4, 2024 19:13
@alexanderniebuhr
Copy link
Member Author

!preview cf-assets-compile

Copy link
Contributor

github-actions bot commented Jan 4, 2024

Snapshots have been released for the following packages:

  • @astrojs/cloudflare@experimental--cf-assets-compile
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--cf-assets-compile tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info @astrojs/cloudflare
🦋  info npm info @astrojs/netlify
🦋  info @astrojs/cloudflare is being published because our local version (0.0.0-cf-assets-compile-20240104191423) has not been published on npm
🦋  warn @astrojs/netlify is not being published because version 4.1.0 is already published on npm
🦋  info Publishing "@astrojs/cloudflare" at "0.0.0-cf-assets-compile-20240104191423"
🦋  success packages published successfully:
🦋  @astrojs/cloudflare@0.0.0-cf-assets-compile-20240104191423
🦋  Creating git tag...
🦋  New tag:  @astrojs/cloudflare@0.0.0-cf-assets-compile-20240104191423
Build Log

> root@0.0.0 build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"

• Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils
• Running build in 3 packages
• Remote caching disabled
::group::@astrojs/netlify:build
cache miss, executing bf32898ddf095c11

> @astrojs/netlify@4.1.0 build /home/runner/work/adapters/adapters/packages/netlify
> tsc

::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing d85a5eb4e4f19bd4

> @astrojs/cloudflare@0.0.0-cf-assets-compile-20240104191423 build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc

::endgroup::

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    4.316s 

@Princesseuh
Copy link
Member

Princesseuh commented Jan 4, 2024

Yes, this is still blocked. The issue is quite complicated, it's caused by some very precise code that was added to workaround another bundling issue. It's a bug fix that cause another bug, the worse kind of bug fix.

If anyone want to check it out, the top top upstream issue causing this, is this one: rollup/rollup#4708, which we worked around by doing this: https://github.com/withastro/astro/blob/218ea0781b362e256f4a6c0b688c6757f88b6461/packages/astro/src/assets/vite-plugin-assets.ts#L38C1-L50, but it causes, well, the issue this PR is encountering. Essentially, the image service doesn't get DCE'd because of the manual chunking option.

The ultimate fix would probably have been to remove the TLA in Astro 4.0, but unfortunately I was so busy with the dev toolbar and other stuff that I forgot about it. (It's a breaking change, unfortunately. A sync function would become async.)

@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch 2 times, most recently from 4160ec2 to 8d8ed84 Compare January 4, 2024 20:19
@@ -22,7 +22,7 @@ export type { DirectoryRuntime } from './entrypoints/server.directory.js';
export type Options = {
mode?: 'directory' | 'advanced';
functionPerRoute?: boolean;
imageService?: 'passthrough' | 'cloudflare';
imageService?: 'passthrough' | 'cloudflare' | 'compile';
Copy link
Member Author

Choose a reason for hiding this comment

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

this needs a docs pr

@alexanderniebuhr
Copy link
Member Author

!preview cf-assets-compile

Copy link
Contributor

github-actions bot commented Jan 4, 2024

Snapshots have been released for the following packages:

  • @astrojs/cloudflare@experimental--cf-assets-compile
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--cf-assets-compile tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info @astrojs/cloudflare
🦋  info npm info @astrojs/netlify
🦋  info @astrojs/cloudflare is being published because our local version (0.0.0-cf-assets-compile-20240104202116) has not been published on npm
🦋  warn @astrojs/netlify is not being published because version 4.1.0 is already published on npm
🦋  info Publishing "@astrojs/cloudflare" at "0.0.0-cf-assets-compile-20240104202116"
🦋  success packages published successfully:
🦋  @astrojs/cloudflare@0.0.0-cf-assets-compile-20240104202116
🦋  Creating git tag...
🦋  New tag:  @astrojs/cloudflare@0.0.0-cf-assets-compile-20240104202116
Build Log

> root@0.0.0 build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"

• Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils
• Running build in 3 packages
• Remote caching disabled
::group::@astrojs/netlify:build
cache miss, executing bf32898ddf095c11

> @astrojs/netlify@4.1.0 build /home/runner/work/adapters/adapters/packages/netlify
> tsc

::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing f045acf84eef6de7

> @astrojs/cloudflare@0.0.0-cf-assets-compile-20240104202116 build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc

::endgroup::

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    4.345s 

@alexanderniebuhr alexanderniebuhr marked this pull request as ready for review January 4, 2024 20:25
@alexanderniebuhr
Copy link
Member Author

@RodrigoTomeES @mikkelsvartveit If you would like to help, this is ready to test: @astrojs/cloudflare@0.0.0-cf-assets-compile-20240104191423

I'll write a docs pr tomorrow and most likely merge this feature Monday if we don't find any issue with the workaround.

@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch from 8d8ed84 to e43e6c5 Compare January 4, 2024 20:33
@OliverSpeir
Copy link

Very exciting PR

@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch from e43e6c5 to e36b60c Compare January 8, 2024 07:01
Copy link
Member

@sarah11918 sarah11918 left a comment

Choose a reason for hiding this comment

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

Only asking you to verify how the warning will actually render. Please test/check the GitHub syntax for that, since it's not usually an inline thing.

But, the content is fine!

.changeset/curvy-falcons-count.md Outdated Show resolved Hide resolved
Copy link
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

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

Only one small nit!

packages/cloudflare/src/index.ts Outdated Show resolved Hide resolved
@alexanderniebuhr alexanderniebuhr force-pushed the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch from e36b60c to 7050491 Compare January 8, 2024 18:13
@alexanderniebuhr
Copy link
Member Author

!preview cf-assets-compile

Copy link
Contributor

github-actions bot commented Jan 9, 2024

Snapshots have been released for the following packages:

  • @astrojs/cloudflare@experimental--cf-assets-compile
Publish Log
🦋  warn ===============================IMPORTANT!===============================
🦋  warn Packages will be released under the experimental--cf-assets-compile tag
🦋  warn ----------------------------------------------------------------------
🦋  info npm info @astrojs/cloudflare
🦋  info npm info @astrojs/netlify
🦋  info @astrojs/cloudflare is being published because our local version (0.0.0-cf-assets-compile-20240109151832) has not been published on npm
🦋  warn @astrojs/netlify is not being published because version 4.1.0 is already published on npm
🦋  info Publishing "@astrojs/cloudflare" at "0.0.0-cf-assets-compile-20240109151832"
🦋  success packages published successfully:
🦋  @astrojs/cloudflare@0.0.0-cf-assets-compile-20240109151832
🦋  Creating git tag...
🦋  New tag:  @astrojs/cloudflare@0.0.0-cf-assets-compile-20240109151832
Build Log

> root@0.0.0 build /home/runner/work/adapters/adapters
> turbo run build --filter="@astrojs/*"

• Packages in scope: @astrojs/cloudflare, @astrojs/netlify, @astrojs/test-utils
• Running build in 3 packages
• Remote caching disabled
::group::@astrojs/netlify:build
cache miss, executing bf32898ddf095c11

> @astrojs/netlify@4.1.0 build /home/runner/work/adapters/adapters/packages/netlify
> tsc

::endgroup::
::group::@astrojs/cloudflare:build
cache miss, executing 16a7d5cdbcc1634e

> @astrojs/cloudflare@0.0.0-cf-assets-compile-20240109151832 build /home/runner/work/adapters/adapters/packages/cloudflare
> tsc

::endgroup::

 Tasks:    2 successful, 2 total
Cached:    0 cached, 2 total
  Time:    4.256s 

@alexanderniebuhr alexanderniebuhr merged commit ecdb8f5 into main Jan 9, 2024
9 of 13 checks passed
@alexanderniebuhr alexanderniebuhr deleted the nbhr/feat_cloudflare_support_compile-time_only_image_config_for_astro_assets branch January 9, 2024 15:22
@github-actions github-actions bot mentioned this pull request Jan 9, 2024
@mikkelsvartveit
Copy link

Fantastic work, thanks guys :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend imageService Api with compile-time only sharp option
7 participants