Skip to content

Commit 71cab20

Browse files
committed
fix: remove inversify of vrender
1 parent 7d6f8e7 commit 71cab20

File tree

29 files changed

+238
-226
lines changed

29 files changed

+238
-226
lines changed

common/config/rush/pnpm-config.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@
8383
* PNPM documentation: https://pnpm.io/package_json#pnpmoverrides
8484
*/
8585
// "globalOverrides": {
86-
// "@visactor/vrender": "0.12.3"
86+
// "@visactor/vrender-core": "1.1.0-alpha.0",
87+
// "@visactor/vrender-kits": "1.1.0-alpha.0",
88+
// "@visactor/vrender-components": "1.1.0-alpha.0",
89+
// "@visactor/vrender-animate": "1.1.0-alpha.0"
8790
// },
8891
/**
8992
* The `globalPeerDependencyRules` setting provides various settings for suppressing validation errors

common/config/rush/pnpm-lock.yaml

Lines changed: 84 additions & 49 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"@visactor/vtable-search": "workspace:*",
2323
"@visactor/vtable-sheet": "workspace:*",
2424
"buble": "^0.20.0",
25-
"@visactor/vchart": "2.0.11-alpha.3",
25+
"@visactor/vchart": "2.0.14-alpha.1",
2626
"markdown-it": "^13.0.0",
2727
"highlight.js": "^11.8.0",
2828
"axios": "^1.4.0",

packages/openinula-vtable/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"devDependencies": {
5555
"cross-env": "^7.0.3",
5656
"increase-memory-limit": "^1.0.7",
57-
"@visactor/vchart": "2.0.11-alpha.3",
57+
"@visactor/vchart": "2.0.14-alpha.1",
5858
"@internal/bundler": "workspace:*",
5959
"@internal/eslint-config": "workspace:*",
6060
"@internal/ts-config": "workspace:*",
@@ -96,4 +96,4 @@
9696
"peerDependencies": {
9797
"openinula": "~0.1.2-SNAPSHOT"
9898
}
99-
}
99+
}

packages/react-vtable/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
"devDependencies": {
5959
"cross-env": "^7.0.3",
6060
"increase-memory-limit": "^1.0.7",
61-
"@visactor/vchart": "2.0.11-alpha.3",
61+
"@visactor/vchart": "2.0.14-alpha.1",
6262
"@internal/bundler": "workspace:*",
6363
"@internal/eslint-config": "workspace:*",
6464
"@internal/ts-config": "workspace:*",
@@ -104,4 +104,4 @@
104104
"@arco-design/web-react": "2.60.2",
105105
"@types/react-reconciler": "0.28.8"
106106
}
107-
}
107+
}

packages/react-vtable/src/table-components/custom/vtable-browser-env-contribution.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
11
import { getTargetCell } from '@visactor/vtable';
22
import type { CreateDOMParamsType, IGraphic } from '@visactor/vtable/es/vrender';
3-
import { ContainerModule, EnvContribution, BrowserEnvContribution } from '@visactor/vtable/es/vrender';
3+
import {
4+
EnvContribution,
5+
BrowserEnvContribution,
6+
serviceRegistry,
7+
contributionRegistry
8+
} from '@visactor/vtable/es/vrender';
49
import { isString } from '@visactor/vutils';
510

611
export type CreateDOMParamsTypeForVTable = CreateDOMParamsType & {
712
graphic: IGraphic;
813
style?: Record<string, any>;
914
};
1015

11-
export const reactEnvModule = new ContainerModule((bind, unbind, isBound, rebind) => {
12-
bind(VTableBrowserEnvContribution).toSelf().inSingletonScope();
13-
if (isBound(EnvContribution)) {
14-
rebind(EnvContribution).toService(VTableBrowserEnvContribution);
15-
} else {
16-
bind(EnvContribution).toService(VTableBrowserEnvContribution);
16+
export const registerReactEnvModule = () => {
17+
serviceRegistry.registerSingletonFactory(VTableBrowserEnvContribution, () => new VTableBrowserEnvContribution());
18+
19+
if (contributionRegistry.has(EnvContribution)) {
20+
contributionRegistry.clear(EnvContribution);
1721
}
18-
});
22+
contributionRegistry.register(EnvContribution, serviceRegistry.get(VTableBrowserEnvContribution));
23+
};
1924

2025
class VTableBrowserEnvContribution extends BrowserEnvContribution {
2126
updateDom(dom: HTMLElement, params: CreateDOMParamsTypeForVTable): boolean {

0 commit comments

Comments
 (0)