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

Consider renaming the module to: rehype-custom-elements #2

Open
marekweb opened this issue Mar 26, 2020 · 2 comments
Open

Consider renaming the module to: rehype-custom-elements #2

marekweb opened this issue Mar 26, 2020 · 2 comments
Labels
help wanted Extra attention is needed question Further information is requested

Comments

@marekweb
Copy link
Owner

marekweb commented Mar 26, 2020

Rationale for keeping the name rehype-components:

  • the module replaces custom elements using render functions that accept props and children as arguments and produce a HTML tree as output, which is consistent with the definition of a component in React and similar frameworks.

Rationale for moving away from the name rehype-components

  • The rendering is static and doesn't have anything to do with React components which re-render dynamically.
  • The module has nothing to do with Web Components either.
  • The module just replaces a HTML element with a new HTML tree, so it's closer to the idea of a search-replace than to the idea of an encapsulated component.

Rationale for rename to rehype-custom-elements

  • The nature of these elements in the HTML is that of custom elements, not of components as they exist in e.g. React JSX expressions.
  • Also unlike React components, these custom elements are not distinguished by a capitalized name, but can instead be distinguished from other elements with a hyphen inside the tag name

Rationale against renaming to rehype-custom-elements

  • The module doesn't have anything to do with DOM-implemented custom elements, nor with the CustomElementRegistry
@marekweb marekweb added help wanted Extra attention is needed question Further information is requested labels Mar 26, 2020
@philipbordallo
Copy link

I say keep the name rehype-components as this module let's you create encapsulated and reusable HTML definitions which sounds a lot like components to me.

Moving to rehype-custom-elements might end up causing confusion because as you mention it doesn't have anything to do with DOM custom elements that live client side. If anything this reminds me of server side rendering or static site generation.

@viktor-yakubiv
Copy link

Hi @marekweb 👋

I am working a similar package as rehype-components was somewhat limited to me. I wanted basically an implementation of web components (with slots and custom properties). The package is not documented but it does work similarly to what web components would be and this is how I imagine a rehype-components plugin to work.

I started a separate repository because I have not been familiar with the unified syntax tree and the ecosystem, so this was a practice to me. Currently, I am rewriting my big universal component to a set of separated components. If you find it appropriate, I can pull it into your repository and we could publish together with extended functionality or I can publish mine independently. If you prefer, reply here reach me out by any other channel. Thank you in advance!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants