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

perf: generate html react props from html spec #2341

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

TrySound
Copy link
Member

Here scraped html spec to generate attributes per tag and added converter to out props meta format.

In the next PR will reuse for settings panel and remove html attributes from generated comomponent props.

Having html attributes not tied to specific framework will let us generate formats compatible with any framework.

Code Review

  • hi @kof, I need you to do
    • conceptual review (architecture, feature-correctness)
  • hi @istarkov, I need you to do
    • detailed review (read every line)

Before requesting a review

  • made a self-review
  • added inline comments where things may be not obvious (the "why", not "what")

Before merging

  • tested locally and on preview environment (preview dev login: 5de6)
  • updated test cases document
  • added tests
  • if any new env variables are added, added them to .env.example and the builder/env-check.js if mandatory

@vercel
Copy link

vercel bot commented Sep 20, 2023

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

Name Status Preview Updated (UTC)
webstudio-builder ✅ Ready (Inspect) Visit Preview Sep 21, 2023 7:37am

@TrySound TrySound changed the title Generate html react props from html spec perf: generate html react props from html spec Sep 20, 2023
Here scraped html spec to generate attributes per tag
and added converter to out props meta format.

In the next PR will reuse for settings panel and remove
html attributes from generated comomponent props.

Having html attributes not tied to specific framework
will let us generate formats compatible with any framework.
import type { Attribute, AttributesByTag } from "./types";
import { htmlPropsDescriptions } from "./descriptions";

// scrub attributes data from https://html.spec.whatwg.org/multipage/indices.html#attributes-3
Copy link
Member

Choose a reason for hiding this comment

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

wasn't this available in mdn-data package? or some other package? I know entire HTML spec is in jsons at this point, even the official spec has a repo, scraping that stuff seems fragile

@TrySound TrySound marked this pull request as draft May 21, 2024 19:50
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