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

fix: brotli let for reassignment #7544

Merged
merged 1 commit into from Mar 31, 2022

Conversation

onevt
Copy link
Contributor

@onevt onevt commented Mar 31, 2022

Description

brotli is re-assigned on line 26

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@patak-dev patak-dev merged commit d0253d7 into vitejs:main Mar 31, 2022
@patak-dev
Copy link
Member

@Niputi something looks odd here, why brotli is initially false and then reassigned to false if it isn't supported? Should we remove this variable or add a comment that we may enable it in the future?

@Niputi
Copy link
Contributor

Niputi commented Mar 31, 2022

looks like a mistake. should default to true as it goes to false when it's not supported

  // disable Brotli on Node<12.7 where it is unsupported:
  if (!zlib.createBrotliCompress) brotli = false

@patak-dev
Copy link
Member

Yes, was it like that in the WMR version? Maybe they ended up disabling it globally because it didn't work as expected?

@Niputi
Copy link
Contributor

Niputi commented Mar 31, 2022

looks like they defaulted to false but haven't given context on why https://github.com/preactjs/wmr/blob/7f96b821c41ed178643749be83d262bf9bc8de5c/packages/wmr/src/lib/polkompress.js#L13

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.

None yet

4 participants