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

Adding an bundlestart event #1435

Merged
merged 3 commits into from May 25, 2018
Merged

Adding an bundlestart event #1435

merged 3 commits into from May 25, 2018

Conversation

KeineLimonade
Copy link

Plugins should be able to run code before a build process starts.

src/Bundler.js Outdated
@@ -207,7 +207,8 @@ class Bundler extends EventEmitter {
});
});
}

this.emit('bundlestart', this.entryFiles)
Copy link
Contributor

Choose a reason for hiding this comment

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

We currently have a buildEnd event when Bundler is done, it would be more consistent to name this one buildStart

Copy link
Author

Choose a reason for hiding this comment

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

Definitely makes sense

@DeMoorJasper
Copy link
Member

Just wondering, this won't block any action, so what's the actual use-case for this?

@codecov-io
Copy link

codecov-io commented May 25, 2018

Codecov Report

Merging #1435 into master will decrease coverage by 0.4%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1435      +/-   ##
==========================================
- Coverage   87.96%   87.55%   -0.41%     
==========================================
  Files          80       80              
  Lines        4653     3809     -844     
==========================================
- Hits         4093     3335     -758     
+ Misses        560      474      -86
Impacted Files Coverage Δ
src/Bundler.js 93.42% <100%> (+0.01%) ⬆️
src/utils/objectHash.js 42.3% <0%> (-42.31%) ⬇️
src/assets/GlobAsset.js 59.21% <0%> (-39.48%) ⬇️
src/utils/syncPromise.js 73.68% <0%> (-26.32%) ⬇️
src/workerfarm/errorUtils.js 64.7% <0%> (-23.53%) ⬇️
src/assets/RawAsset.js 73.68% <0%> (-21.06%) ⬇️
src/utils/urlJoin.js 84.61% <0%> (-15.39%) ⬇️
src/utils/is-url.js 88.88% <0%> (-11.12%) ⬇️
src/utils/md5.js 92.3% <0%> (-7.7%) ⬇️
src/visitors/matches-pattern.js 94.73% <0%> (-5.27%) ⬇️
... and 36 more

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 83dfa3e...6bac3e5. Read the comment docs.

@KeineLimonade
Copy link
Author

There are no use cases when running parcel via cli. But for embedding parcel in a larger scope it can be helpful to know when a new build started. For example I use a build server and used this event to set up a webhook.
As this feature is non-blocking, I saw no reason to not implement it. However it is not that important...

@DeMoorJasper
Copy link
Member

@Tom-Julux Alright :)

I'll merge this in as it makes sense as we already print a message that build starts to cli, makes it available in the api as well :)

@DeMoorJasper DeMoorJasper merged commit 304eb5f into parcel-bundler:master May 25, 2018
@dsych
Copy link

dsych commented May 28, 2018

I am just curious, when can this make it into the official release?

@DeMoorJasper
Copy link
Member

It’ll be part of 1.9

Sent with GitHawk

devongovett pushed a commit that referenced this pull request Oct 15, 2018
Plugins should be able to run code before a build process starts.
devongovett pushed a commit that referenced this pull request Oct 15, 2018
Plugins should be able to run code before a build process starts.
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

6 participants