Repository navigation
Conversation
Add the required functionality to `_collectRoutes` function of `ngtools_impl.ts`, so that the `ngtools` respect provided factories with `p.useFactory` (as well as provided values with `useValue`). Closes #15305
|
Hi @alexeagle, @chuckjaz, @IgorMinar, @mhevery, @tbosch; anybody will have a look on this PR in future? |
|
@hansl Can you look at this change? |
|
In general, when using I might not have understood what you are trying to achieve... |
|
Agree, @hansl would probably be best to understand the use case... |
|
Hi @tbosch, if you look at the referenced issue #15305, you could have a better understanding about what this PR aims to solve.
The current situation already prevents use of |
|
We collect the routing information in order to know (in advance) the routes for static code splitting into separate bundles. This fix does not provide this as we don't analyze the content of the provider (we can't). Also, in general, we should spend a fair amount of time designing and discussing this issue rather than jumping to a half-working solution that does only solve one of the symptoms. I do think @ocombe has something on his timeline to fix the issue above properly. I will discuss the issue itself with the i18n team internally, but I'm very confident that this PR does not fix anything you're trying to fix. |
|
Hi @hansl, thanks for both your detailed explanation and advices. In this case, I'll keep an eye on further releases, for possible fixes. |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Add the required functionality to
_collectRoutesfunction ofngtools_impl.ts, so that thengtoolsrespect provided factories withp.useFactory(as well as provided values withuseValue).Closes #15305
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
Providing a factory method (
useFactory) for the DI tokenROUTEScauses the discovery of lazy-routes to fail. Further details are documented on #15305.What is the new behavior?
With this PR, it's possible to provide a factory method for the DI token
ROUTES, and@ngtools/webpackaccepts the values provided by the factory withuseFactory(as well as provided values withuseValue).Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information:
For these changes, no tests and documents have been added or changed. Actually, there were already no specific tests and documents found to evaluate/document the current and new behavior.