GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||
GeezerVison is showing github.com — perf(core): tree-shake TransferState from resources without hydration by nigrosimone · Pull Request #72241 · angular/angular Conversation
|
| }); | ||
|
|
||
| it(`should read resources from TransferState on the client`, () => { | ||
| globalThis['ngServerMode'] = undefined; |
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about this , Could we remove it ?
If we override globalThis here ( without restore it ) while running the test suite, it could fail or cause unexpected behavior in other tests.
Also I think the rest of test are enough
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The outer describe already resets it: beforeEach sets ngServerMode to true and afterEach sets it back to undefined, so nothing leaks to other tests. I would keep the test because it is the only one that covers the lookup provided by provideClientHydration(). Without it, a change in hydration.ts could stop resource from reading the SSR cache and no test would fail. I can move it into its own describe with an explicit save and restore if you prefer.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.