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
feat(ivy): add support for typings in ngcc (and some minor refactorings) #25203
Conversation
So there's good news and bad news. 👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there. 😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request. Note to project maintainer: This is a terminal state, meaning the |
You can preview 4a45993 at https://pr25203-4a45993.ngbuilds.io/. |
const originalDtsFileName = entryPoint.getDtsFileNameFor(sourceFileName); | ||
const originalDtsContents = readFileSync(originalDtsFileName, 'utf8'); | ||
|
||
// Tranform the `.d.ts` file based on the recorded source file changes. |
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.
Tranform => Transform
ngtsc's static resolver can evaluate function calls where parameters have default values. In TypeScript code these default values live on the function definition, but in ES5 code the default values are represented by statements in the function body. A new ReflectionHost method getDefinitionOfFunction() abstracts over this difference, and allows the static reflector to more accurately evaluate ES5 code.
In some code formats (e.g. ES5) methods can actually be function expressions. For example: ```js function MyClass() {} // this static method is declared as a function expression MyClass.staticMethod = function() { ... }; ```
Since non-flat module formats (esm2015, esm5) have different structure than their flat counterparts (and since we are operating on JS files inside `node_modules/`, we need to configure TS to include deeply nested JS files (by specifying a sufficiently high `maxNodeModuleJsDepth`). Remains to be determined if this has any (noticeable) performance implications.
…sform` In preparation of adding support for transforming `.d.ts` files.
Rebased, resolved conflicts, and addressed comment. |
4a45993
to
4d117fa
Compare
You can preview 4d117fa at https://pr25203-4d117fa.ngbuilds.io/. |
Rebased #25406 on top of this ✔️ |
Relates to FW-82 |
Superceded by #25406 |
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. |
Sits on top of #25090 (so the first 7 commits are from there).
PR Checklist
PR Type
Does this PR introduce a breaking change?