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

Show metadata on connector docs #32334

Merged
merged 10 commits into from
Nov 10, 2023
Merged

Conversation

evantahler
Copy link
Contributor

@evantahler evantahler commented Nov 9, 2023

This PR loads up the latest metadata entry for connectors and injects useful info at the top of the page:

This is accomplished by adding a remark which adds some custom logic to the markdown processor. We download the latest version of the connector registry at build time and inject a new table at the top of the page showing some handy information:

Screenshot 2023-11-09 at 4 15 39 PM

Pros of this approach:

  • No modification of the markdown needed
  • No new react components to support in-product

Cons of this approach:

  • The registry is downloaded at build-time, and therefore can get stale. We should periodically rebuild the docs site to overcome this.

Copy link

vercel bot commented Nov 9, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 10, 2023 10:46pm

@octavia-squidington-iii octavia-squidington-iii added the area/documentation Improvements or additions to documentation label Nov 9, 2023
@octavia-squidington-iii octavia-squidington-iii removed the area/documentation Improvements or additions to documentation label Nov 10, 2023
@evantahler evantahler requested a review from bnchrch November 10, 2023 00:16
@evantahler evantahler marked this pull request as ready for review November 10, 2023 00:17
Copy link
Contributor

@bnchrch bnchrch left a comment

Choose a reason for hiding this comment

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

Great addition. A few nits but I wouldnt stand in the way!

docusaurus/src/remark/docsHeaderDecoration.js Outdated Show resolved Hide resolved
docusaurus/src/remark/docsHeaderDecoration.js Outdated Show resolved Hide resolved
docusaurus/src/remark/docsHeaderDecoration.js Outdated Show resolved Hide resolved
docusaurus/src/remark/docsHeaderDecoration.js Outdated Show resolved Hide resolved
docusaurus/src/remark/docsHeaderDecoration.js Show resolved Hide resolved
Copy link
Contributor

@nataliekwong nataliekwong left a comment

Choose a reason for hiding this comment

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

Amazing :)

Copy link
Contributor

@timroes timroes left a comment

Choose a reason for hiding this comment

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

Want to test something still later. Please hold back merging yet (in case you wake up before I'm getting to test this).

docusaurus/src/remark/docsHeaderDecoration.js Outdated Show resolved Hide resolved
docusaurus/src/remark/docsHeaderDecoration.js Outdated Show resolved Hide resolved
docusaurus/src/remark/docsHeaderDecoration.js Outdated Show resolved Hide resolved
@evantahler
Copy link
Contributor Author

There's also something wacky with remark that's injecting an <undefined> container around the div which I'm trying to figure out how to remove. I think it's an interaction with the image element.

*/
const fetchCatalog = async () => {
if (loading) {
await sleep(500);
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose for waiting here?

@evantahler
Copy link
Contributor Author

After the latest batch of suggestions:

Screenshot 2023-11-10 at 9 55 31 AM

@evantahler
Copy link
Contributor Author

Screenshot 2023-11-10 at 10 18 02 AM I've removed the table and replaced it with a div - I just couldn't get remark to render it without literal whitespaces which the browser complained about

@evantahler
Copy link
Contributor Author

Ok, I think this is ready now. The comments have been addressed. I've replaced the timer and per-page invocation of fetchCatalog with one invocation at the start of the pligin then every transformer just waits until it is done await Promise.resolve(registryFetcher);.

Thanks for reminding me how real programming language work, @timroes!

@evantahler evantahler enabled auto-merge (squash) November 10, 2023 22:49
@evantahler evantahler merged commit f4d2f7b into master Nov 10, 2023
13 checks passed
@evantahler evantahler deleted the evan/docs-connnector-metadata branch November 10, 2023 22:51
Comment on lines +18 to +19
/s$/,
""
Copy link
Contributor

Choose a reason for hiding this comment

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

@evantahler Why are we generically removing any s at the end of a connector type?

Copy link
Contributor

@timroes timroes Nov 13, 2023

Choose a reason for hiding this comment

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

Ah I think I get it, this is only here to make destinations -> destination, sources -> source. I was misreading this as being executed on the actual name of the connector (which we often call the connector type in the rest of the product :D)

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.

5 participants