question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Partial builds with NPM package?

See original GitHub issue

I’m using Webpack now and I’m wondering if something like “custom builds” is possible when using NPM version of the package. Since Bluebird is already modularized, it would be nice if there was some way of excluding features I’m not using.

For now I’ll fork it and do

require('./timers.js')(Promise,INTERNAL);
// require('./any.js')(Promise,Promise$_CreatePromiseArray,PromiseArray);
// require('./race.js')(Promise,INTERNAL);
require('./call_get.js')(Promise);
// require('./filter.js')(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection);
// require('./generators.js')(Promise,apiRejection,INTERNAL);
// require('./map.js')(Promise,PromiseArray,INTERNAL,apiRejection);
// require('./nodeify.js')(Promise);
// require('./promisify.js')(Promise,INTERNAL);
// require('./props.js')(Promise,PromiseArray);
// require('./reduce.js')(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection,INTERNAL);
// require('./settle.js')(Promise,Promise$_CreatePromiseArray,PromiseArray);
// require('./some.js')(Promise,Promise$_CreatePromiseArray,PromiseArray,apiRejection);
require('./progress.js')(Promise,isPromiseArrayProxy);
require('./cancel.js')(Promise,INTERNAL);

but it would be cool to have a better solution.

Edit: Oh wait, I can’t fork it and edit since this is generated.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
benjamingrcommented, Aug 14, 2018

For my specific use case, I’m only using Bluebird because I want long stack traces. So I’m not totally confident which files I could potentially include and exclude, since I’m not too familiar with the source code, but I omitted the files suggested above.

Just an update that we’re working with v8 to have long stack traces in production by default for native promises. My approach (personally) over the last few years has been to try and improve the native promises situation.

That said - you can always just run the partial build (with the build tool) and require that.

0reactions
petermikitshcommented, Aug 14, 2018
screen shot 2018-08-14 at 7 47 35 am

v3.5.1 (latest) actually ships the core (partial) build to NPM-- no building necessary. Switched to that, and shaved off a few kb’s. Thanks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Run npm install only when needed and/or partially
An approach that works for me is to use MSBuild incremental build support in ... Unfortunately there's no way to install only the...
Read more >
html-partials-compiler - npm
html-partials-compiler. Easily build a static html file by including html partials using npm. This is open source software.
Read more >
How To Speed Up Continuous Integration Build With New ...
How To Speed Up Continuous Integration Build With New NPM CI And package-lock.json. It never hurts to get some more speed ( ...
Read more >
How to make your own npm package with typescript
There is a lot of mystery around making your own npm package. ... We can use this to do incremental/watch builds npm run...
Read more >
cash/partial_builds.md at master - GitHub
Partial Builds. Cash is bundled using minipacco, therefore it supports partial builds out of the box. Guide. Replace the content of src/methods.ts with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found