You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
chore: auto update reflect metadata module (#1648)
updated entrypoint to auto import reflect metadata
updated docs
updated tsconfig with modern NodeJS module resolution
removed unused ancient builds
simplified CI
Copy file name to clipboardExpand all lines: README.md
+6-15
Original file line number
Diff line number
Diff line change
@@ -63,24 +63,18 @@ You can get the latest release and the type definitions using your preferred pac
63
63
> pnpm add inversify reflect-metadata
64
64
```
65
65
66
-
> ❕**Hint!** If you want to use a more type-safe version of reflect-metadata, try [`@abraham/reflection`](https://www.npmjs.com/package/@abraham/reflection)
66
+
`reflect-metadata` will be automatically imported by inversify.
67
67
68
68
The InversifyJS type definitions are included in the inversify npm package.
69
69
70
-
> :warning:**Important!** InversifyJS requires TypeScript >= 4.4 and the `experimentalDecorators`, `emitDecoratorMetadata`, `types` and `lib`
71
-
compilation options in your `tsconfig.json` file.
70
+
> :warning:**Important!** InversifyJS requires TypeScript >= 4.4 and the `experimentalDecorators`, `emitDecoratorMetadata`, compilation options in your `tsconfig.json` file.
72
71
73
72
```json
74
73
{
75
-
"compilerOptions": {
76
-
"target": "es5",
77
-
"lib": ["es6"],
78
-
"types": ["reflect-metadata"],
79
-
"module": "commonjs",
80
-
"moduleResolution": "node",
81
-
"experimentalDecorators": true,
82
-
"emitDecoratorMetadata": true
83
-
}
74
+
"compilerOptions": {
75
+
"experimentalDecorators": true,
76
+
"emitDecoratorMetadata": true
77
+
}
84
78
}
85
79
```
86
80
@@ -93,8 +87,6 @@ InversifyJS requires a modern JavaScript engine with support for:
93
87
94
88
If your environment doesn't support one of these you will need to import a shim or polyfill.
95
89
96
-
> :warning:**The `reflect-metadata` polyfill should be imported only once in your entire application** because the Reflect object is meant to be a global singleton. More details about this can be found [here](https://github.com/inversify/InversifyJS/issues/262#issuecomment-227593844).
97
-
98
90
Check out the [Environment support and polyfills](https://github.com/inversify/InversifyJS/blob/master/wiki/environment.md)
99
91
page in the wiki and the [Basic example](https://github.com/inversify/inversify-basic-example) to learn more.
100
92
@@ -152,7 +144,6 @@ When a class has a dependency on an interface we also need to use the `@inject`
0 commit comments