Repository navigation
Conversation
Meligy
force-pushed
the
fix/exports-misread-as-routes
branch
from
December 27, 2016 13:53
39fdd97 to
2ce4ad5
Compare
clydin
reviewed
Dec 27, 2016
Member
There was a problem hiding this comment.
Keep first check to avoid empty strings?
Contributor
Author
There was a problem hiding this comment.
Empty strings are errors. It's unintentional that they silently did nothing I believe.
Maybe could give a better error message, but that's a separate improvement I preferred to keep unrelated to this PR.
2 of 3 tasks
…oad routes paths
The change avoids the compiler CLI internal API from mismatching the following case as lazy loading
```
import { NonLazyLoadedModule } from './non-lazy-loaded/non-lazy-loaded.module';
export function getNonLazyLoadedModule() { return NonLazyLoadedModule; }
export const routes = [
{ path: '/some-path', loadChildren: getNonLazyLoadedModule }
];
```
The output of the check is later passed to `RouteDef.fromString()`, so, it makes sense to be only a string.
Fixes angular/angular-cli#3204
Meligy
force-pushed
the
fix/exports-misread-as-routes
branch
from
December 31, 2016 09:29
2ce4ad5 to
93af424
Compare
Contributor
Author
|
Merged as part of #13678 |
Contributor
Author
|
Actually. the commit wa not merged. |
Contributor
|
LGTM. |
Contributor
|
Merged as aeed737 |
Contributor
Author
|
@matsko thanks heaps man. |
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Please check if the PR fulfills these requirements
N/A for the private API // CC @hansl
N/A
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)
If you use an official tool that uses the Angular Compiler CLI private API, like Angular CLI (or @ng-tools Webpack plugin), and you have some route code like:
Building this (for example
ng buildusing Angular CLI beta.24) shows a build error:And it also shows in the browser.
What is the new behavior?
No build error in console or browser in that case. Build just succeeds and browser functionality shows no error. Loading modules (lazy or not) works as expected.
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:
The core problem in the previous case is that the compiler CLI internal API treats the function
getNonLazyLoadedModule()as a lazy loading string(like
'./non-lazy-loaded/non-lazy-loaded.module#NonLazyLoadedModule').It passes the output as the
entryargument toRouteDef.fromString(entry: string), where the errorentry.split is not a functionhappens.@hansl would be an ideal reviewer for this, having created the private API.
Fixes angular/angular-cli#3204