-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1050 from forcedotcom/sm/core7-jsforce
Sm/core7-jsforce
- Loading branch information
Showing
44 changed files
with
320 additions
and
431 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Migrating `@salesforce/core` from v6 to v7 | ||
|
||
v7 replaces `jsforce` with the new `@jsforce/jsforce-node`. It's a much smaller library. See https://github.com/jsforce/jsforce/issues/1374. | ||
|
||
If you use `@salesforce/core` AND jsforce together, you should switch to using `@jsforce/jsforce-node`. | ||
|
||
If you use another library that is using jsforce modules or types, be sure to update to a version of that library which uses `@jsforce/jsforce-node` | ||
|
||
## Interfaces=>Type | ||
|
||
We're going to standardize on Types instead of interfaces. They're almost identical except where they aren't. You probably won't notice. | ||
|
||
## Breaking changes to AliasAccessor | ||
|
||
Alias accessor had previously deprecated methods that are removed by this PR. | ||
|
||
- `set` | ||
- `unset` | ||
- `unsetAll` | ||
- `write` (has been a no-op since v6) | ||
|
||
If you use these, typically via StateAggregator, update your code to use `setAndSave` or `unsetAndSave` | ||
|
||
## SfError | ||
|
||
SfError previously had a `cause` that conflicted with the more recent ES2022 native Error.cause | ||
|
||
SfError has some new convenience methods. SfError.create (pass in props instead of setting 5 via params and others via instance methods). | ||
SfError.wrap and the `cause` prop of SfError.create are now typed as `unknown` for convenience (throw the `unknown` from a catch block without having to worry about types!). | ||
SfError.data is now constrained to be AnyJson (some sort of JSON/primitive or collection of that). | ||
|
||
## Top-level exports | ||
|
||
v7 exports more top-level modules. If you had previously imported via `@salesforce/core/lib/foo` you may be able to import them from the top-level. See the package.json for what's available now. | ||
|
||
everything that was previously available via `import ____ from '@salesforce/core'` is still available the same way. | ||
|
||
``` | ||
"./messages": { | ||
"types": "./lib/messages.d.ts", | ||
"require": "./lib/messages.js", | ||
"import": "./lib/messages.js" | ||
}, | ||
"./logger": { | ||
"types": "./lib/logger.d.ts", | ||
"require": "./lib/logger.js", | ||
"import": "./lib/logger.js" | ||
}, | ||
"./project": { | ||
"types": "./lib/project.d.ts", | ||
"require": "./lib/project.js", | ||
"import": "./lib/project.js" | ||
}, | ||
"./sfError": { | ||
"types": "./lib/sfError.d.ts", | ||
"require": "./lib/sfError.js", | ||
"import": "./lib/sfError.js" | ||
}, | ||
"./stateAggregator": { | ||
"types": "./lib/stateAggregator/stateAggregator.d.ts", | ||
"require": "./lib/stateAggregator/stateAggregator.js", | ||
"import": "./lib/stateAggregator/stateAggregator.js" | ||
}, | ||
"./configAggregator": { | ||
"types": "./lib/config/configAggregator.d.ts", | ||
"require": "./lib/config/configAggregator.js", | ||
"import": "./lib/config/configAggregator.js" | ||
}, | ||
"./lifecycle": { | ||
"types": "./lib/lifecycleEvents.d.ts", | ||
"require": "./lib/lifecycleEvents.js", | ||
"import": "./lib/lifecycleEvents.js" | ||
}, | ||
"./envVars": { | ||
"types": "./lib/config/envVars.d.ts", | ||
"require.js": "./lib/config/envVars.js", | ||
"import": "./lib/config/envVars.js" | ||
}, | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
01b5620
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logger Benchmarks - ubuntu-latest
Child logger creation
469593
ops/sec (±0.39%
)471071
ops/sec (±0.68%
)1.00
Logging a string on root logger
848118
ops/sec (±6.15%
)815084
ops/sec (±6.29%
)0.96
Logging an object on root logger
636707
ops/sec (±5.34%
)607732
ops/sec (±6.29%
)0.95
Logging an object with a message on root logger
5316
ops/sec (±217.18%
)8890
ops/sec (±204.54%
)1.67
Logging an object with a redacted prop on root logger
479366
ops/sec (±6.81%
)422802
ops/sec (±12.09%
)0.88
Logging a nested 3-level object on root logger
385060
ops/sec (±10.13%
)363163
ops/sec (±8.12%
)0.94
This comment was automatically generated by workflow using github-action-benchmark.
01b5620
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Logger Benchmarks - windows-latest
Child logger creation
338484
ops/sec (±0.56%
)346417
ops/sec (±0.44%
)1.02
Logging a string on root logger
784094
ops/sec (±10.80%
)824843
ops/sec (±11.96%
)1.05
Logging an object on root logger
604801
ops/sec (±6.79%
)635539
ops/sec (±8.09%
)1.05
Logging an object with a message on root logger
6373
ops/sec (±206.35%
)2320
ops/sec (±242.77%
)0.36
Logging an object with a redacted prop on root logger
437363
ops/sec (±12.52%
)483051
ops/sec (±8.36%
)1.10
Logging a nested 3-level object on root logger
318606
ops/sec (±6.77%
)337662
ops/sec (±4.83%
)1.06
This comment was automatically generated by workflow using github-action-benchmark.