insomnia/packages/insomnia-app/app
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
..
__jest__ Remove Core and Designer specific cases (#3034) 2021-02-03 12:19:22 +13:00
__mocks__ Update onboarding flow (#3101) 2021-02-26 09:13:37 +13:00
__tests__ Add plugin bundle to default config (#3092) 2021-02-26 10:10:21 +13:00
account Update Babel and ESLint and fix all related errors (#2032) 2020-04-09 10:32:19 -07:00
common Differential (Additive/Removal) patching when switching between design / debug (#3124) 2021-03-03 12:57:09 -05:00
datasets Add trailing commas to ESLint + Prettier 2018-12-12 12:36:11 -05:00
icons Remove more designer and APP_ID code (#3040) 2021-02-03 20:07:11 +13:00
main Portable windows builds (#3125) 2021-02-28 15:54:18 +01:00
models Prompt for import as collection or document (#3130) 2021-03-03 10:16:48 +13:00
network Add initial segment events (#3121) 2021-02-26 20:57:19 +01:00
plugins Prompt for import as collection or document (#3130) 2021-03-03 10:16:48 +13:00
static Remove Core and Designer specific cases (#3034) 2021-02-03 12:19:22 +13:00
sync Add pull dropdown to homepage (#3074) 2021-02-12 14:52:43 +13:00
templating Add plugin bundle to default config (#3092) 2021-02-26 10:10:21 +13:00
ui Differential (Additive/Removal) patching when switching between design / debug (#3124) 2021-03-03 12:57:09 -05:00
main.development.js Update onboarding flow (#3101) 2021-02-26 09:13:37 +13:00
renderer.html Rename some old things 2020-04-26 14:08:50 -07:00
renderer.js Merge All Repositories into Monorepo for easier maintenance (#629) 2017-11-26 20:45:40 +00:00