Skip to content
This repository was archived by the owner on Feb 26, 2024. It is now read-only.

fix(tsc): tsconfig.json strict:true #1044

Merged
merged 2 commits into from
Jun 18, 2018
Merged

Conversation

JiaLiPassion
Copy link
Collaborator

change tsconfig.json

"strict" : true

There are a lot of null error, and current this PR is WIP, to make it compilable, we need to modify some interface such as Zone.current, Zone.currentTask, Zone.scheduleMacroTask, ZoneSpec.onXXX because they all may return null or undefined.

@mhevery , do you think we should do this now? it will have breaking change to zone API and may affect angular. please review, thank you.

@mhevery
Copy link
Contributor

mhevery commented Mar 14, 2018

can you resolve this?

@JiaLiPassion
Copy link
Collaborator Author

@mhevery , this PR is not finished, I want to confirm that if we add strict : true, some API may changes (add optional ? or add | null type definition) such as

scheduleMacroTask(
      source: string, callback: Function, data: TaskData, customSchedule: (task: Task) => void,
      customCancel: (task: Task) => void): MacroTask;

will become

scheduleMacroTask(
      source: string, callback: Function, data?: TaskData, customSchedule?: (task: Task) => void,
      customCancel?: (task: Task) => void): MacroTask;

so should I do it now? it may have impact to angular

@mhevery
Copy link
Contributor

mhevery commented Mar 14, 2018 via email

@JiaLiPassion
Copy link
Collaborator Author

@mhevery , got it, I will continue to finish this one.

@JiaLiPassion JiaLiPassion changed the title WIP(tsc): tsconfig.json strict:true fix(tsc): tsconfig.json strict:true Mar 17, 2018
@JiaLiPassion
Copy link
Collaborator Author

JiaLiPassion commented Mar 17, 2018

@mhevery , I have finished this one and resolved the conflicts, the CI is red because of saucelabs ios 8.4 is down, please review. thank you.

@mhevery mhevery merged commit f238908 into angular:master Jun 18, 2018
JiaLiPassion added a commit to JiaLiPassion/angular that referenced this pull request Jan 24, 2019
1. Update zone.js to 0.8.29
2. Because zone.js angular/zone.js#1044 use `strict:true` in tsconfig, so
some of the API of Zone change. Such as `Zone.parent` will return `Zone | null` instead of `Zone`,
so several usage need to be updated in `angular` side too.
3. Also because zone.js add some new patch (fetch/customElement), the size of polyfill increases
 a little
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants