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

[v2.0.0] Change writeBundle signature to match generateBundle #3361

Merged
merged 1 commit into from Feb 5, 2020

Conversation

lukastaegert
Copy link
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:
Resolves #2717

Description

This is one of the few truly breaking changes in this release as there is no two-step deprecation; but to be honest, I could not think of another good name for this hook and well, writing a downward compatible plugin is not that difficult because you can do this:

{
  writeBundle(options, bundle = options) {
    // now bundle is always the bundle, both in 1.x and 2.x
  }
}

So you can detect the signature of the hook by checking if the second parameter is used; in that case, it is the bundle, otherwise the first is the bundle.

@lukastaegert lukastaegert added this to In progress in Release 2.0.0 via automation Jan 29, 2020
@lukastaegert lukastaegert moved this from In progress to Ready for merge in Release 2.0.0 Jan 29, 2020
@codecov
Copy link

codecov bot commented Jan 29, 2020

Codecov Report

Merging #3361 into release-2.0.0 will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@              Coverage Diff               @@
##           release-2.0.0    #3361   +/-   ##
==============================================
  Coverage          94.07%   94.07%           
==============================================
  Files                174      174           
  Lines               5977     5977           
  Branches            1768     1768           
==============================================
  Hits                5623     5623           
  Misses               191      191           
  Partials             163      163
Impacted Files Coverage Δ
src/rollup/rollup.ts 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfdc86b...115a001. Read the comment docs.

@bathos
Copy link
Contributor

bathos commented Feb 3, 2020

This would absolutely be useful to us! Currently we obtain output options in generate bundle in one plugin but act on them in writeBundle — which works because in this case there’s only one output, but I suspect it would imply a race condition if we did have more than one output.

@lukastaegert lukastaegert merged commit a01adb7 into release-2.0.0 Feb 5, 2020
Release 2.0.0 automation moved this from Ready for merge to Done Feb 5, 2020
@lukastaegert lukastaegert deleted the 2.0.0-write-bundle-signature branch February 5, 2020 19:33
@lukastaegert lukastaegert mentioned this pull request Feb 6, 2020
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Release 2.0.0
  
Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants