Skip to content

fix: emitFile, eager/priority modes, noscript, srcset - #5

Open
lxsmnsyc wants to merge 1 commit into
expansionfrom
image-delivery
Open

fix: emitFile, eager/priority modes, noscript, srcset#5
lxsmnsyc wants to merge 1 commit into
expansionfrom
image-delivery

Conversation

@lxsmnsyc

@lxsmnsyc lxsmnsyc commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

Stops the browser from ever downloading the untouched original, sends processed
files through the bundler, and adds an eager prop for the image above the
fold. Readers with no JavaScript now get the image.

Changes

  • The img carries a srcset built from the last output format. A browser that
    supports none of the source types now picks a sized variant instead of the
    full size original.
  • The order of the output option now matters. The last format is the fallback,
    so it should be the most widely supported one.
  • The source module points at the largest variant of the fallback format. The
    original file is no longer imported, so it never reaches the bundle.
  • Processed files go through the bundler on build with emitFile, so base,
    assetsDir and the build manifest apply to them. The dev server still writes
    them to the public directory.
  • SolidImage takes an eager prop. The image loads without waiting for the
    observer, and the server renders it in full so the browser finds it while it
    parses the page.
  • The server renders a noscript copy of the image. Browsers never load the
    content of a noscript element, so it costs nothing for everyone else.
  • Variant groups are computed once in a memo and shared by the source elements
    and the img.

@pkg-pr-new

pkg-pr-new Bot commented Sep 9, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@solidjs/image@5

commit: 3659561

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