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

Provide toString() in image objects created by lqip-loader #10891

Closed
wants to merge 1 commit into from

Conversation

tats-u
Copy link
Contributor

@tats-u tats-u commented Feb 2, 2025

Pre-flight checklist

  • I have read the Contributing Guidelines on pull requests.
  • If this is a code change: I have written unit tests and/or added dogfooding pages to fully verify the new behavior.
  • If this is a new API or substantial change: the PR has an accompanying issue (closes #0000) and the maintainers have approved on my working plan.

Motivation

Image objects created by lqip-loader don't provide their own toString(). It causes the [object Object] output when they are loaded via CSS (#10862).

Test Plan

  • Confirm all images are loaded as usual.
  • Should we add a component that has a background image in a dogfooding page?

Test links

Deploy preview: https://deploy-preview-10891--docusaurus-2.netlify.app

Related issues/PRs

#10862

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Feb 2, 2025
Copy link

netlify bot commented Feb 2, 2025

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit 3bb4de2
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/679f58d06eb69b0008d2fee6
😎 Deploy Preview https://deploy-preview-10891--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

github-actions bot commented Feb 2, 2025

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO Report
/ 🟠 68 🟢 98 🟢 96 🟢 100 Report
/docs/installation 🟠 53 🟢 97 🟢 100 🟢 100 Report
/docs/category/getting-started 🟠 72 🟢 100 🟢 100 🟠 86 Report
/blog 🟠 62 🟢 96 🟢 100 🟠 86 Report
/blog/preparing-your-site-for-docusaurus-v3 🟠 64 🟢 92 🟢 100 🟢 100 Report
/blog/tags/release 🟠 61 🟢 96 🟢 100 🟠 86 Report
/blog/tags 🟠 74 🟢 100 🟢 100 🟠 86 Report

Copy link
Collaborator

@slorber slorber left a comment

Choose a reason for hiding this comment

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

I didn't have time to investigate the linked issue yet, but this isn't the way I want to address this problem.

The loader could be disabled when the file is requested in a CSS file. We already do that for the SVGR plugin using issuer, because transforming SVGs to React component code doesn't make sense when using CSS such as url('/icon.svg'). This problem is quite similar.

@tats-u
Copy link
Contributor Author

tats-u commented Feb 3, 2025

I see. Looks like it's less useful than I thought in lqip-loader.

@tats-u tats-u closed this Feb 3, 2025
@tats-u
Copy link
Contributor Author

tats-u commented Feb 3, 2025

Note: still useful in responsive-loader.

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

Successfully merging this pull request may close these issues.

3 participants