insomnia/packages/insomnia-app/app/common
SaintAPI a2bc704f80
Differential (Additive/Removal) patching when switching between design / debug (#3124)
* fix(import) do differential patching for design activity imports

This patch adds differential patching for imports that occur during the switching between
design and debug tabs inside of Designer. As reported through #2971, and others, this patch
favors existing data over imported data, values that exist already on the document will remain
unchanged, only new values (including array based values) will be added / removed.

This also includes a bypass feature for urls, currently these options are not exposed through
the interface but could be. This feature is an object to allow for future properties for
preference-based patching.

- Adds `options.enableDiffBasedPatching` and `options.enableDiffDeep` to `importRaw` for backwards compat.
- Adds `options.bypassDiffProps.url` for url bypassing and use an object for future items.
- Adds `diffPatchObj` based on differential patching for objects (works with arrays as well).

Future ideas:

- `hasBeenModifiedByUser` property map object to allow changing properties that haven't been touched by the user with options.

fixes: #2971, #2882, #3038, #2442

* adds some basic tests

- also adds jest (which was (mistakenly) not there before)
- does not call `.hasOwnProperty` directly, per https://eslint.org/docs/rules/no-prototype-builtins (which, we will add more formally at a later date)

* don't special-case workspaces

this ensures the behavior of the initial PR is more preserved

Co-authored-by: Dimitri Mitropoulos <dimitrimitropoulos@gmail.com>
2021-03-03 12:57:09 -05:00
..
__fixtures__ Add trailing commas to ESLint + Prettier 2018-12-12 12:36:11 -05:00
__mocks__ Update onboarding flow (#3101) 2021-02-26 09:13:37 +13:00
__tests__ Differential (Additive/Removal) patching when switching between design / debug (#3124) 2021-03-03 12:57:09 -05:00
analytics.js Add initial segment events (#3121) 2021-02-26 20:57:19 +01:00
api-specs.js Initial pass to combine eslint and prettier (#2166) 2020-05-15 10:54:07 +12:00
constants.js Portable windows builds (#3125) 2021-02-28 15:54:18 +01:00
database.js Stop automatically appending .git to git repository URLs (#3054) 2021-02-09 09:17:47 +01:00
documentation.js Add bitbucket cloud docs, add documentation tooltip to git settings modal header (#2518) 2020-08-18 08:57:21 +12:00
grpc-events.js Support template tags with gRPC (#2926) 2020-12-18 00:38:21 +13:00
grpc-paths.js gRPC URL bar improvements - streaming type & package groups (#2883) 2020-12-09 17:42:50 +13:00
har.js Fix Copy as CURL with Multipart (#2740) 2020-11-24 14:33:16 +13:00
hotkeys-listener.js Add extra "editor" scope for plugin themes 2019-08-09 12:15:29 -04:00
hotkeys.js Update workspace or api spec name as appropriate (#3122) 2021-03-02 10:32:32 +13:00
import.js Differential (Additive/Removal) patching when switching between design / debug (#3124) 2021-03-03 12:57:09 -05:00
keyboard-keys.js Update Babel and ESLint and fix all related errors (#2032) 2020-04-09 10:32:19 -07:00
log.js Add Show App Logs Folder to help (#2728) 2020-10-21 00:01:47 +13:00
markdown-to-html.js Add trailing commas to ESLint + Prettier 2018-12-12 12:36:11 -05:00
migrate-from-designer.js Add migration analytics events (#3123) 2021-03-02 12:13:51 +13:00
misc.js Differential (Additive/Removal) patching when switching between design / debug (#3124) 2021-03-03 12:57:09 -05:00
render.js Support template tags with gRPC (#2926) 2020-12-18 00:38:21 +13:00
select-file-or-folder.js Support reuploading a proto file (#2832) 2020-11-17 11:01:50 +13:00
send-request.js Add plugin bundle to default config (#3092) 2021-02-26 10:10:21 +13:00
sorting.js Add sort options for sidebar rows (#2738) 2020-12-01 13:37:57 +13:00
strings.js Update workspace or api spec name as appropriate (#3122) 2021-03-02 10:32:32 +13:00