Skip to content
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

Closed
wants to merge 18 commits into from

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Jul 30, 2018

Sits on top of #25090 (so the first 7 commits are from there).

PR Checklist

PR Type

[x] Feature
[x] Refactoring (no functional changes, no api changes)

Does this PR introduce a breaking change?

[ ] Yes
[x] No

@gkalpak gkalpak added feature Issue that requests a new feature action: review The PR is still awaiting reviews from at least one requested reviewer refactoring Issue that involves refactoring or code-cleanup comp: ivy labels Jul 30, 2018
@googlebot
Copy link

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 cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@gkalpak gkalpak requested a review from alxhub July 30, 2018 20:24
@mary-poppins
Copy link

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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tranform => Transform

alxhub and others added 18 commits August 20, 2018 16:35
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.
@gkalpak
Copy link
Member Author

gkalpak commented Aug 20, 2018

Rebased, resolved conflicts, and addressed comment.

@mary-poppins
Copy link

You can preview 4d117fa at https://pr25203-4d117fa.ngbuilds.io/.

@petebacondarwin
Copy link
Member

@gkalpak we have rolled this PR into the ngcc-integration-test branch and associated PR: #25406

We need to add any changes you make here to that, because @alxhub is going to try to land the whole lot in one go.

@gkalpak
Copy link
Member Author

gkalpak commented Aug 21, 2018

Rebased #25406 on top of this ✔️

@manughub
Copy link
Contributor

Relates to FW-82

@petebacondarwin
Copy link
Member

Superceded by #25406

@gkalpak gkalpak deleted the feat-ivy-ngcc-typings branch October 14, 2018 10:09
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: review The PR is still awaiting reviews from at least one requested reviewer cla: no feature Issue that requests a new feature refactoring Issue that involves refactoring or code-cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants