Skip to content

Add lit-labs/context docs#1100

Open
AndrewJakubowicz wants to merge 6 commits intomainfrom
labs-context-docs
Open

Add lit-labs/context docs#1100
AndrewJakubowicz wants to merge 6 commits intomainfrom
labs-context-docs

Conversation

@AndrewJakubowicz
Copy link
Copy Markdown
Contributor

@AndrewJakubowicz AndrewJakubowicz commented May 5, 2023

Add (correctly this time), the lit-labs/context documentation.

Note - there is still a strange issue with some of the complex types. This issue is what made me notice #1099

Depends on #1093

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2023

A live preview of this PR will be available at the URL(s) below.
The latest URL will be appended to this comment on each push.
Each build takes ~5-10 minutes, and will 404 until finished.

https://pr1100-51a9bb2---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1100-fa63b3b---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1100-495af6e---lit-dev-5ftespv5na-uc.a.run.app/
https://pr1100-ca5321d---lit-dev-5ftespv5na-uc.a.run.app/

@justinfagnani
Copy link
Copy Markdown
Contributor

This is looking relatively good. We need a lot more jsdoc in the package, and it'd be really nice to be able to order things so that createContext, consume and provide should up first.

@AndrewJakubowicz AndrewJakubowicz force-pushed the update-docs-typedoc-2 branch from 15047da to c6f2a80 Compare May 5, 2023 17:47
Base automatically changed from update-docs-typedoc-2 to main May 5, 2023 18:06
/** @lit-labs/context symbol ordering */
'createContext',
'consume',
'provide',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's add ContextConsumer, ContextProvider, and ContextRoot here for now.

tsConfigPath: pathlib.join(contextDir, 'tsconfig.json'),
entrypointModules: [
pathlib.join(contextSrcDir, 'index.ts'),
pathlib.join(contextSrcDir, 'lib/context-request-event.ts'),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need these other files as entrypoint modules? Since we want everything importing from index, can typedoc not just find them in the module graph?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agree - I have to investigate this now that I have stabilized updating all the underlying stuff & fixed many other confounding issues.

Previously when I only used the entrypoint we only got a small cross section of APIs generated. See https://pr1092-ec9e4af---lit-dev-5ftespv5na-uc.a.run.app/docs/api/context/ as an example.

But many things have been fixed since then & I understand what is going on better now. Will try this again to clean it up.
Great comment!

let [_, pkg, pathMinusExtension] = match;

if (pkg === 'labs/context') {
console.log(pkg, pathMinusExtension);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove

const allPages: Pages = [];
const allSymbols: SymbolMap = {};
for (const pkg of config.packages) {
const app = new typedoc.Application();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

At some point I thought I read some docs that typedoc had options for a monorepo, so you didn't need to make a new app for each package. I can't remember it though. This might matter for getting crosslinks between packages. Right now ReactiveElement say isn't a link in the context docs.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah - I need to investigate this further. I feel like I read that somewhere as well.

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.

2 participants