feat(blob): add @nuxt/image integration via image.path config#698
Closed
onmax wants to merge 2 commits intonuxt-hub:mainfrom
Closed
feat(blob): add @nuxt/image integration via image.path config#698onmax wants to merge 2 commits intonuxt-hub:mainfrom
onmax wants to merge 2 commits intonuxt-hub:mainfrom
Conversation
|
@onmax is attempting to deploy a commit to the NuxtLabs Team on Vercel. A member of the Team first needs to authorize it. |
commit: |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
7232d53 to
51e463f
Compare
2fc47f3 to
9b7406d
Compare
Contributor
Author
|
Hey @atinux, @RihanArfan, could you please review this PR? Thank you! |
25b0549 to
cca1648
Compare
Contributor
|
Hey @onmax I really appreciate the work and idea on it. But I really think it would be better instead to document how to use Nuxt Image with NuxtHub Blob without having to create another abstraction layer for it. |
Contributor
Author
|
Agreed - will document manual integration instead of abstraction. Keeping the pr for reference. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #521
What
Adds automatic
@nuxt/imageprovider for NuxtHub blob storage. When@nuxt/imageis installed andhub.blob.image.pathis configured:nuxthubprovider based on blob driver/cdn-cgi/image/w=X,q=Y/path)/_vercel/image?url=...&w=X&q=Y)Reproduction
Usage
images: path for nuxt/nitro router/a-folder-in-blob-storage/photo.jpg: full path in the blob storagePlatform-Specific Notes
Cloudflare
Vercel
@vercel/blobinstalled +BLOB_READ_WRITE_TOKENenv varnitro.preset: vercelin nuxt.config.tsvercel.json:{ "images": { "sizes": [300, 640, 750, 828, 1080, 1200, 1920, 2048, 3840] } }Technical Notes
@nuxt/image@^2.0.0(exports runtime providers)defineProvider()wrapper for proper @nuxt/image integrationUnresolved issues
Docs
Not sure if it is better to create a new Guide or leave the docs in the
/features/blobDev mode
During testing, I noticed that dev mode doesn't work straight away:
--remoteflag is used).Possible solutions
A. Require '--remote' for blob images. Document that blob images require 'nuxt dev --remote'.
B. Return a placeholder image in dev when the blob storage is empty.
C. Fallback to public folder: In dev, if the blob is empty, check the public folder as a fallback.
What is the preferred approach?