docs(docs-infra): Add cross-links to API pages#57346
docs(docs-infra): Add cross-links to API pages#57346JeanMeche wants to merge 2 commits intoangular:mainfrom
Conversation
|
Deployed adev-preview for 8bc381f to: https://ng-dev-previews-fw--pr-angular-angular-57346-adev-prev-ckp3dlh0.web.app Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt. |
1802547 to
bc1710c
Compare
bc1710c to
28c77fd
Compare
There was a problem hiding this comment.
I think this shows (for the other PR with the core/globals) that we need to maybe have module_name, and a "title" field? I'm worried we are using module_name for more, but then Dev-mode globals breaks
There was a problem hiding this comment.
Yes, we'll be able to reuse the logic that I added in #57365
There was a problem hiding this comment.
This computation happens for every export. I also wonder, why is this necessary? can you explain? i.e. why do we need to extract the "imported" symbols and returning them as symbols here is a bit ambiguous I feel like.
There was a problem hiding this comment.
I've added a comment, let me know if it makes it more clear for you.
|
I like the general approach, but I also don't know how it was done before in the early versions of angular.dev, or why we stopped/reverted the logic, so I will defer to @jelbourn on this for now. |
f2b9887 to
04769fa
Compare
bbc06cf to
39a8441
Compare
7affd47 to
51cb4db
Compare
7b52fd0 to
2b0993a
Compare
|
Deferring to other reviewers for this specific change. |
|
Currently trying to reduce the scope of this PR, as it might feel a bit large. |
jelbourn
left a comment
There was a problem hiding this comment.
I got part of the way through before I need to run for the day, but here's my initial comments
Not sure if you were planning to do this already once you got an okay on the approach, but I'll mention anyway: we should split this change up into more granular commits. In particular:
- Separating the symbol collection into its own commit (and this also needs tests)
- Changing the representation of class inheritance in its own commit
- Minimum necessary changes to the renderer to accomodate any
DocEntrystructure changes - Further changes to surface the links in the rendered output
|
I splitted the changes accross multiple commits, I should ease the review of all the changes (or we can spin them off in other PRs) I'll add the missings tests for the API extraction when I can. |
There was a problem hiding this comment.
@jelbourn Do you think we should do this concatenation during extraction ?
There was a problem hiding this comment.
I don't feel strongly either way
There was a problem hiding this comment.
I don't feel strongly either way
There was a problem hiding this comment.
Is this regex valid? When I try it in a couple of different regex visualizers, it fails. Maybe they can't handle this much lookahead?
At the very least it would be good to add a comment that explains the regex at a high level
There was a problem hiding this comment.
It is valid, make sure that the visualizer supports ES regex, like https://regex101.com/
devversion
left a comment
There was a problem hiding this comment.
LGTM, great work! Minor comments in the compiler
There was a problem hiding this comment.
| if (moduleSpecifier.startsWith('@angular')) { | |
| if (moduleSpecifier.startsWith('@angular/')) { |
There was a problem hiding this comment.
would it be better/more generic if we filter everything that is not a relative path?
There was a problem hiding this comment.
That would also expose symbols from RxJS, which is not wanted.
There was a problem hiding this comment.
It might be the responsibility of the "consumer" of the symbols list to filter out items that cannot be rendered. Or even cooler, we could link to the RxJS docs that way 😄
|
@JeanMeche there is a conflict with the |
This commit changes the structure of the API extraction files to include all symbols used inside a package. The structure is a `Map`, Symbol => package eg: 'ApplicationRef' => '@angular/core'
|
This PR was merged into the repository by commit 01030d5. The changes were merged into the following branches: main, 18.2.x |
|
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. |
This commit adds links to our own symbols in the API pages, including the Code TOC, the description and the Usage notes.
This commit also add the implement/extends symbols for classes & interfaces.
The generation process now logs warnings for links that couldn't not be generated because the symbols can be resolved in the given context.
fixes #57128
fixes #57183
fixes #55571
Worthy examples: