mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
migration additions -- part 2
Signed-off-by: Roman <ixrock@gmail.com>
This commit is contained in:
parent
9ca7104a2a
commit
95794af5b2
13
src/common/libs-config.ts
Normal file
13
src/common/libs-config.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Global configuration setup for external packages.
|
||||||
|
// Should be imported at the top of app's entry points.
|
||||||
|
import { configure } from "mobx";
|
||||||
|
import { enableMapSet, setAutoFreeze } from "immer";
|
||||||
|
|
||||||
|
// Mobx
|
||||||
|
configure({
|
||||||
|
enforceActions: "never", // allows to skip using @action when class-method updates some state
|
||||||
|
});
|
||||||
|
|
||||||
|
// Immer
|
||||||
|
setAutoFreeze(false); // allow to merge observables
|
||||||
|
enableMapSet(); // allow merging maps and sets
|
||||||
@ -1,4 +1,6 @@
|
|||||||
|
import "./common/libs-config";
|
||||||
import fetchMock from "jest-fetch-mock";
|
import fetchMock from "jest-fetch-mock";
|
||||||
|
|
||||||
// rewire global.fetch to call 'fetchMock'
|
// rewire global.fetch to call 'fetchMock'
|
||||||
fetchMock.enableMocks();
|
fetchMock.enableMocks();
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
// Main process
|
// Main process
|
||||||
|
|
||||||
import "../common/system-ca";
|
import "../common/system-ca";
|
||||||
|
import "../common/libs-config"
|
||||||
import "../common/prometheus-providers";
|
import "../common/prometheus-providers";
|
||||||
import * as Mobx from "mobx";
|
import * as Mobx from "mobx";
|
||||||
import * as LensExtensions from "../extensions/core-api";
|
import * as LensExtensions from "../extensions/core-api";
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import "./components/app.scss";
|
import "./components/app.scss";
|
||||||
|
import "../common/libs-config";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import * as Mobx from "mobx";
|
import * as Mobx from "mobx";
|
||||||
import * as MobxReact from "mobx-react";
|
import * as MobxReact from "mobx-react";
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
// Helper for working with storages (e.g. window.localStorage, NodeJS/file-system, etc.)
|
// Helper for working with storages (e.g. window.localStorage, NodeJS/file-system, etc.)
|
||||||
|
|
||||||
import { action, comparer, CreateObservableOptions, IObservableValue, observable, reaction, toJS, when } from "mobx";
|
import { action, comparer, CreateObservableOptions, IObservableValue, observable, reaction, toJS, when } from "mobx";
|
||||||
import produce, { Draft, enableMapSet, setAutoFreeze } from "immer";
|
import produce, { Draft } from "immer";
|
||||||
import { isEqual, isFunction, isPlainObject, merge } from "lodash";
|
import { isEqual, isFunction, isPlainObject, merge } from "lodash";
|
||||||
import logger from "../../main/logger";
|
import logger from "../../main/logger";
|
||||||
|
|
||||||
setAutoFreeze(false); // allow to merge observables
|
|
||||||
enableMapSet(); // allow merging maps and sets
|
|
||||||
|
|
||||||
export interface StorageAdapter<T> {
|
export interface StorageAdapter<T> {
|
||||||
[metadata: string]: any;
|
[metadata: string]: any;
|
||||||
getItem(key: string): T | Promise<T>;
|
getItem(key: string): T | Promise<T>;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user