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
- doctor-service: printWarnings accepts an optional trackResult matching
its contracts; runSetupScript returns the setup script result instead
of resolving undefined; canExecuteLocalBuild no longer dereferences
its optional argument
- deprecation tracer: a report dropped for lack of a logger is no
longer latched as delivered - it reports once a logger exists
- yok: global.$injector is an accessor pair, so a direct third-party
assignment stays synchronized with the binding getInjector() reads
- docs: note the useValue + shared:false quirk; show where Injector is
imported from in the late-lookup example
Copy file name to clipboardExpand all lines: dependency-injection.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -123,7 +123,7 @@ Provider kinds:
123
123
|---|---|---|
124
124
| Class |`provide(Token, Impl)` / `{ provide, useClass }`| constructed with `new Impl()` inside an injection context, so `inject()` works in its fields |
125
125
| Lazy class |`provideLazy(Token, () => Impl)` / `{ provide, useLazyClass }`| loader runs on first `get()` only — keeps startup lazy |
126
-
| Value |`{ provide, useValue }`| registered instance; re-registering replaces the cached instance |
126
+
| Value |`{ provide, useValue }`| registered instance; re-registering replaces the cached instance. With `shared: false` there is no resolver and `get()` throws — a preserved legacy quirk|
127
127
| Factory |`{ provide, useFactory }`| called inside an injection context |
128
128
129
129
`shared: false` makes a provider transient: every resolution constructs a fresh
Copy file name to clipboardExpand all lines: extending-cli.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ module.exports = function (hookArgs) {
92
92
};
93
93
```
94
94
95
-
*`inject()` is valid in the synchronous part of the hook body — not after an `await`. Resolve what you need up front; for late lookups, grab the container first: `const injector = inject(Injector)`, then `injector.get(...)` later.
95
+
*`inject()` is valid in the synchronous part of the hook body — not after an `await`. Resolve what you need up front; for late lookups, grab the container first: `const injector = inject(Injector)` (`Injector` is exported from `nativescript/contracts` too), then `injector.get(...)` later.
96
96
*`hookArgs` contains the parameters of the CLI function being hooked; its shape depends on the hook point. Declare it only when you need it — a hook may also take no parameters at all. A future typed hook API (`defineHook` with an explicit context object) will replace this parameter; it is the one remaining piece of the legacy convention.
97
97
* Tokens resolve by class first and by their canonical name on a miss, so this works even if your dependency tree carries its own copy of `nativescript` — a duplicated token class still resolves to the running CLI's service.
98
98
* Only a first tranche of services has typed tokens so far ([dependency-injection.md](dependency-injection.md#available-contracts) lists them); a service without a token is reachable by its registry name — `inject("logger")` — as a migration bridge.
0 commit comments