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

VDOM properties documentation #1235

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

natevw
Copy link

@natevw natevw commented Feb 13, 2025

This is a rough (but potentially publishable??) start on documenting Preact's props handling. (some background/context)

For the most part I think this documentation is non-controversial, I struggled in many cases speaking "on Preact's behalf" while writing this out:

  • what's officially considered "public API" vs. implementation detail
  • what's technically the domain of Preact core vs. compat vs. JSX/htm/VDOM
  • and what Preact claims for itself vs. simply will always try to follow "same as whatever React documents"

…in the end though, I mostly just stuck to a bit higher level in general which left room for handwavey summaries anyway.

I also struggled a bit just with general terminology. Are these really "VDOM" properties, or are they "component" properties? (React sort of documents "built-in components" as if it had simply entirely subsumed them into its own framework….) Again, handwavey was my friend but would like to avoid any egregious discrepancies to how the rest of the docs tend to discuss the various distinctions.

How close is this to a "good enough" starting point that could be published?

@natevw natevw marked this pull request as ready for review February 14, 2025 01:06
@natevw natevw changed the title [wip] VDOM properties documentation VDOM properties documentation Feb 14, 2025
Copy link
Member

@rschristian rschristian left a comment

Choose a reason for hiding this comment

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

This is brilliant, and something a few users have been asking about for a long while! Thank you so much for writing it! We really appreciate it.

One thing that's missing is perhaps the preference for properties, as Jason mentioned (if (name in domElement), etc). That's something we should probably note, maybe with a little asterisk for the handful of exceptions (you don't have to explicitly list them out).

I'm also a bit apprehensive about having a doc filled with so many links to PRs. I love backing references, that's great, but as you've probably noted things are moving re:v11 and generally we try to contain all information here rather than having users piece it together from external sources. Will have a think on it though.

@natevw natevw requested a review from rschristian February 14, 2025 22:05
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