Skip to content

Conversation

@mattrobenolt
Copy link
Contributor

zopfli is not required by any means, especially for local development
and CI. So if there's an issue installing this, we should just avoid
attempting to compress rather than error all over the place. This keeps
the error to just a simple warning instead so we're aware and can see
this if something were to fail in a production build, but won't affect
any other environment.

Also, note that this is explicitly checking against paths rather than
testing with a require() since with npm@2, the dependency is actually
a sub-dependnecy of compression-webpack-plugin and can't be required
from outside that module. So it doesn't help to test that. And with
npm@3, the module gets flatted to the top level, so we need to check
both places.

I'll replicate this to sentry-plugins too.

Copy link
Member

Choose a reason for hiding this comment

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

fwiw we probably need this in getsentry and sentry-plugins, or we need to not use zopfli in those

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll replicate this to sentry-plugins too.

For some reason, it's not explicitly used for getsentry, so it doesn't need to go there, but we should probably add this snippet anyways to precompress there.

Copy link
Member

Choose a reason for hiding this comment

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

why dont we just use the normal builtin gzip compression if zopfli isnt present

Copy link
Member

@dcramer dcramer left a comment

Choose a reason for hiding this comment

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

lgtm if we do the gzip change

zopfli is not required by any means, especially for local development
and CI. So if there's an issue installing this, we should just avoid
attempting to compress rather than error all over the place. This keeps
the error to just a simple warning instead so we're aware and can see
this if something were to fail in a production build, but won't affect
any other environment.

Also, note that this is explicitly checking against paths rather than
testing with a `require()` since with npm@2, the dependency is actually
a sub-dependnecy of `compression-webpack-plugin` and can't be `require`d
from outside that module. So it doesn't help to test that. And with
npm@3, the module gets flatted to the top level, so we need to check
both places.
@mattrobenolt mattrobenolt merged commit 3bb0ddb into master Dec 30, 2016
mattrobenolt added a commit to getsentry/sentry-plugins that referenced this pull request Dec 30, 2016
@mattrobenolt mattrobenolt deleted the zopfli branch December 30, 2016 22:43
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants