-
Notifications
You must be signed in to change notification settings - Fork 545
Description
Current state
jsforce
is an isomorphic (works on browser and node) library, as such it needs to ship multiple builds to cover most scenarios:
- CJS & ESM build for node
- ESM browser builds
- browser bundles + minified builds
- TS source code (
src
folder)
For browser usage this isn't much of an issue since it either loads jsforce from a CDN (can get the full minified build only) or bundle it, but in node projects you end up with around ~28mb of unused code (dist
, browser
and src
folders) + additional deps from the jsforce CLI and browser builds (commander
, inquirer
, open
, @babel/runtime
, @babel/runtime-corejs3
, core-js
, etc).
To help with this, jsforce v3 will start publishing a new node-only pkg for node projects using jsforce that want a smaller package, this should help reducing the final build size and also during security scans (secury reports about library never used in node build).
How it will work:
Each jsforce
release will be followed by a @jsforce/jsforce-node
release, both having the same package version (e.g. jsforce@3.5.1
-> @jsforce/jsforce-node@3.5.1
).
This new pkg will not live in a new repo or branch, it will be generated by modifying the package.json before publish (or locally for testing), specifically:
- Changing
name
field to@jsforce/jsforce-node
- Removing browser/CLI-related folders from
files
field. - Removing
bin
field - Removing browser/CLI dependencies
Will I still be able to use jsforce
in node projects?
Yes! jsforce
will continue to work on browsers and node.
Will this new pkg include additional, node-only features?
No. @jsforce/jsforce-node
will only be a lighter(size) version of jsforce
.