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

Document types #4011

Merged
merged 23 commits into from
Feb 21, 2022
Merged

Document types #4011

merged 23 commits into from
Feb 21, 2022

Conversation

Rich-Harris
Copy link
Member

@Rich-Harris Rich-Harris commented Feb 19, 2022

Follow-up to #4010. The idea here is to make types linkable throughout the docs — rather than the unreadable gibberish you get from automatic doc generators, this literally just copies the source .d.ts into the docs, extracts leading JSDoc comments, and crosslinks everything.

So for example in the endpoint docs, the RequestHandler type becomes a link...

image

...that points here:

image

  • Prevent type docs linking to themselves (e.g. RequestHandler -> RequestHandler in the example above)
  • Improve the styles a bit
  • Add more JSDoc comments explaining the various types this can happen in a follow-up
  • Rethink App vs App — maybe we rename the class? follow-up in Rename App #4030
  • Include types in search index
  • Either remove links from lsp attributes, or have the tooltip actually link to them
  • make comments work on mobile (i.e. not stretch out into the distance) somehow

@changeset-bot
Copy link

changeset-bot bot commented Feb 19, 2022

⚠️ No Changeset found

Latest commit: 98ce2ac

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pngwn
Copy link
Member

pngwn commented Feb 19, 2022

Can we set a max length on the snippets? Some of them are very difficult to read on mobile.

@Rich-Harris
Copy link
Member Author

Do you mean running Prettier on the snippets with a shorter line length, or something?

@pngwn
Copy link
Member

pngwn commented Feb 19, 2022

Yeah, that would be good if it is possible.

@Rich-Harris
Copy link
Member Author

Made that change. The JSDoc comments will need to be updated (and maintained) manually though

@Rich-Harris
Copy link
Member Author

Would be good if this linked to Adapter. At the very least the HTML shouldn't be visible:

image

@Rich-Harris Rich-Harris mentioned this pull request Feb 21, 2022
@Rich-Harris Rich-Harris merged commit df6f126 into master Feb 21, 2022
@Rich-Harris Rich-Harris deleted the document-types branch February 21, 2022 19:58
@baseballyama baseballyama mentioned this pull request Mar 6, 2022
5 tasks
baseballyama added a commit to baseballyama/kit that referenced this pull request Mar 6, 2022
sveltejs#4011 added @sveltejs/adapter-static .
But sveltejs#4239 removed it.
Then deploy process is failed. (Please see sveltejs#4244 (comment) for more details)
Rich-Harris pushed a commit that referenced this pull request Mar 6, 2022
* add @sveltejs/adapter-static.

#4011 added @sveltejs/adapter-static .
But #4239 removed it.
Then deploy process is failed. (Please see #4244 (comment) for more details)

* workspace:^1.0.0-next.29 -> workspace:*
@ignatiusmb ignatiusmb mentioned this pull request Jul 18, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Document types
2 participants