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

Multiple URLs for components? #1022

Open
GarthDB opened this issue Mar 28, 2024 · 0 comments
Open

Multiple URLs for components? #1022

GarthDB opened this issue Mar 28, 2024 · 0 comments

Comments

@GarthDB
Copy link
Contributor

GarthDB commented Mar 28, 2024

I'm working on a PR to update Spectrum. We have multiple implementations and corresponding websites, and it would be nice to add them to the data. I think this is related to #1017, but it could provide a real-world example by showing how I'd like to add the data.

Currently, the data in the repo looks like this:

"name": "Menu",
"url": "https://react-spectrum.adobe.com/react-spectrum/Menu.html",

This is a great start, but this URL points to only the React implementation of this component when we have other implementations and the design definition.

I'd like to propose turning the url string into a urls array of objects with name and URL strings, like this:

"name": "Menu",
"urls": [
  {
    "name": "Spectrum Design",
    "url": "https://spectrum.adobe.com/page/menu/"
  },
  {
    "name": "React Spectrum",
    "url": "https://react-spectrum.adobe.com/react-spectrum/Menu.html"
  },
  {
    "name": "Spectrum Web Components",
    "url": "https://opensource.adobe.com/spectrum-web-components/components/menu/"
  }
]

This doesn't have to be a breaking change for existing data; we could leave the url property in the component definition and add urls.

Trying to think through implications, we could leave the url property as required to make sure the component pages with links still render the same, or we could update the definition to use either the url property or the first object in the urls array if it exists.

I'm happy to put together a PR if this could help.

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

No branches or pull requests

1 participant