Skip to content

node-only release #1374

@cristiand391

Description

@cristiand391

Current state

jsforce is an isomorphic (works on browser and node) library, as such it needs to ship multiple builds to cover most scenarios:

  1. CJS & ESM build for node
  2. ESM browser builds
  3. browser bundles + minified builds
  4. 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:

  1. Changing name field to @jsforce/jsforce-node
  2. Removing browser/CLI-related folders from files field.
  3. Removing bin field
  4. 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.

ref:
#534
#1117

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions