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

Update url-loader to 2.0.1 #7378

Merged
merged 1 commit into from
Jul 18, 2019
Merged

Conversation

heyimalex
Copy link
Contributor

This closes #7359 by making IMAGE_INLINE_SIZE_LIMIT=0 actually disable image inlining.

We use url-loader's limit option to set the line at which images will be inlined, and we basically expose this option to our end users via the IMAGE_INLINE_SIZE_LIMIT environment variable. Most people using it want to disable inlining images all together (the major motivator for adding it at all was I think for strict CSP), and our documentation said setting the value to zero would do that. However, it did the opposite: url-loader treated zero as "no limit".

The update to 2.x fixes this; zero means nothing gets inlined. The other changes from the version bump shouldn't affect us:

  • minimum node version is 8.9.x, we already require 8.10.x
  • the limit was "greater than", is now "greater than or equal to"

Validated this change manually, checking whether the image was inlined at different vales of IMAGE_INLINE_SIZE_LIMIT, everything worked like a charm.

@iansu
Copy link
Contributor

iansu commented Jul 18, 2019

Let's see if we can get CI passing and then merge this.

This closes facebook#7359 by making IMAGE_INLINE_SIZE_LIMIT=0 actually disable image inlining.

We use url-loader's `limit` option to set the line at which images will be inlined, and we basically expose this option to our end users via the IMAGE_INLINE_SIZE_LIMIT environment variable. Most people using it want to disable inlining images all together (the major motivator for adding it at all was I think for strict CSP), and our documentation said setting the value to zero would do that. However, it did the opposite: url-loader treated zero as "no limit".

The update to 2.x fixes this; zero means nothing gets inlined. The other changes from the version bump shouldn't affect us:
- minimum node version is 8.9.x, we already require 8.10.x
- the limit was "greater than", is now "greater than or equal to"
@heyimalex heyimalex merged commit a95c573 into facebook:master Jul 18, 2019
@iansu iansu added this to the 3.1 milestone Jul 18, 2019
@lock lock bot locked and limited conversation to collaborators Jul 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(master) Advanced config IMAGE_INLINE_SIZE_LIMIT=0 inlines all images (should disable inline)
4 participants