-
Notifications
You must be signed in to change notification settings - Fork 403
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(router-plugin): resolve infinite redirects and browser hanging #1430
Conversation
You are the best!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Just some small tweaks and questions
"baseUrl": "./", | ||
"module": "es2015", | ||
"types": [] | ||
"module": "esnext" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to move away from the default bootstrapped config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not touch these configs during this PR. I touched it because dynamic import is a part of the esnext system.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have we done dynamic imports in the ng5 sample?
Would this be part of typical ng5 code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's part of TS itself, not ng5.
I would really like to get this into the v3.6 release! |
More changes coming after last night's hectic debugging session! |
@markwhitfeld please see it, we need it in release |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we restore some of these tests?
Are you happy that the issue is solved? You had some issues after our debugging session... were you able to resolve them?
} from '../'; | ||
|
||
describe('NgxsRouterPlugin', () => { | ||
it('should dispatch router state events', fakeAsync(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we restore this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. This test is not explicit and we always have to fix it when we do any change. I don't think it's a good approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could restore this test but run expectations on other things, not logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This type of test is often called a characterization test. It is not necessarily saying that the behavior is right or wrong but rather just documenting what the current behavior is. The value here is to know what has changed when it does.
You could suffix the test name with "(Characterization)" to make its value explicit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will move it to another file for this type of tests to avoid mess.
]); | ||
})); | ||
|
||
it('should dispatch router state events for another route', fakeAsync(async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we restore this test?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure. This test is not explicit and we always have to fix it when we do any change. I don't think it's a good approach.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could restore this test but run expectations on other things, not logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See other comment about Characterization tests
@@ -231,304 +168,6 @@ describe('NgxsRouterPlugin', () => { | |||
const state = TestBed.get(Store).selectSnapshot(TestState); | |||
expect(state).toBeTruthy(); | |||
expect(state.url).toEqual('/testpath'); | |||
})); | |||
|
|||
describe('RouterDataResolved', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we restore this fixture? Or has it moved?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was moved to another file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks! Did any tests disappear from this fixture in the move?
@arturovt I would love to get this into the next release. Could you make the small tweaks above and add a section about this to the announcement article (as part of this PR) if it is not there yet? |
I'm very busy. I will try to find a chance to push those changes at weekends. |
@arturovt Should I merge this PR and then you can make the further changes (regarding the tests) on this branch and submit another PR? |
As you wish. If you think that those changes, that we've made while debugging, are OK, then you can go with merging. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #1293 #1407
What is the new behavior?
Does this PR introduce a breaking change?
Other information