Skip to content

diff#3

Closed
imagekitio wants to merge 12 commits intoIK-2197from
review
Closed

diff#3
imagekitio wants to merge 12 commits intoIK-2197from
review

Conversation

@imagekitio
Copy link
Copy Markdown
Contributor

No description provided.

manu4543 added 12 commits May 3, 2026 15:38
- Deleted the fixtures.ts file as it was no longer needed.
- Updated images.spec.ts to remove redundant tests and simplify image loading checks.
- Removed edge case tests for video components and unnecessary attributes in videos.spec.ts.
- Updated package.json to include @imagekit/javascript dependency.
- Modified upload-auth.ts to use the correct public key environment variable.
- Changed images.astro to use astro:assets for image handling and removed outdated examples.
- Updated upload.astro to use the new upload method from @imagekit/javascript.
- Implement getSrcSet to generate responsive variants from widths/densities
- Apply user transformations first, append trailing step with crop:at_max
- Drop fit/position mapping (incompatible with at_max)
- Drop redundant height from final transform step (at_max preserves AR)
- Resolve urlEndpoint from prop > integration config > env vars
- Strip ImageKit-internal props from rendered <img> attributes
- Update test-app images.astro cases (urlEndpoint override, absolute URL,
  layout=none for densities) and refresh snapshots
…module

- Add virtual:@imagekit/astro/config Vite plugin in the integration that
  exposes the resolved urlEndpoint and transformationPosition
- Video.astro consumes the virtual module so urlEndpoint can come from
  imagekit({ urlEndpoint }) in astro.config.mjs without env vars or props
- Resolution priority: prop > integration config > PUBLIC_/IMAGEKIT_URL_ENDPOINT
- Inject type declaration for the virtual module via injectTypes so
  consumer projects get autocomplete and typecheck
- Update test-app videos.astro and refresh snapshots
…PUBLIC_ env

Centralize ImageKit config resolution, harden the image service, and
simplify the OG helper. Also remove PUBLIC_IMAGEKIT_URL_ENDPOINT since
every SDK caller runs server-side.

Resolution & integration:
- getImageKitConfig is the single resolver: prop > integration config
  (virtual:@imagekit/astro/config) > IMAGEKIT_URL_ENDPOINT
- Video.astro delegates to getImageKitConfig instead of resolving inline
- Integration only carries forward known service config keys
  (urlEndpoint, transformationPosition); foreign keys from a previous
  service no longer leak through
- Warn when urlEndpoint cannot be parsed as a URL
- Mark virtual:@imagekit/astro/config external in tsup

Image service:
- Throw a clear error when no urlEndpoint can be resolved (was: silent '')
- Add IKImageTransform type, remove all `as any` casts
- Align quality presets with Astro sharp defaults (low/mid/high/max
  = 25/50/75/100, was 30/80/90/95)

Helpers & types:
- Drop `format` option from getOgImageTags; emit a single image URL for
  og:image and twitter:image (ImageKit auto-format negotiates
  WebP/AVIF/JPEG via the Accept header)
- VideoProps extends Astro's HTMLAttributes<'video'> for full HTML
  video attribute autocomplete (replaces [key: string]: unknown)

test-app:
- Add /og page exercising getOgImageTags (default, minimal, custom
  dimensions + transformation)
- Link /og from index page
…K srcs

Convert image service from ExternalImageService to LocalImageService and
delegate non-ImageKit srcs (local assets, allow-listed external hosts) to
Astro's bundled sharp service. ImageKit URLs continue to bypass /_image and
go straight to ik.imagekit.io with full IK transformations.

- Add `additionalEndpoints?: string[]` option for multi-account / custom
  IK domains; their hosts auto-merge into image.domains and image.remotePatterns
- Drop `domains` and `remotePatterns` from imagekit() options; non-IK hosts
  belong in image.domains / image.remotePatterns directly
- Pass `imagekitHosts` through service config so the service knows which
  absolute URLs to treat as IK
- isImageKitSrc routes /_astro/, /@fs/, /@id/, data:, blob:, and non-IK
  http(s) hosts to sharp; everything else goes to IK
- Wire parseURL/transform/propertiesToHash from sharp so /_image accepts
  non-IK requests (fixes "Configured image service is not a local service")
- validateOptions delegates to sharp for non-IK srcs (enables size inference)

Test app:
- Add additionalEndpoints (ik.imgkit.net) and image.domains (placehold.co)
- Add hero.jpg local asset + sharp-delegation cases on /images
- Add /md page with 5 routing cases and Playwright snapshot spec
- Update /images snapshots: full-width srcset shrinks (LocalImageService
  uses LIMITED_RESOLUTIONS instead of DEFAULT_RESOLUTIONS)

Docs:
- README "How it works" section explaining the two-path routing
@imagekitio imagekitio closed this May 4, 2026
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