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

feat: react adapters #6490

Closed
wants to merge 4 commits into from
Closed

feat: react adapters #6490

wants to merge 4 commits into from

Conversation

pengx17
Copy link
Contributor

@pengx17 pengx17 commented Mar 15, 2024

Add custom react wrapper, custom react renderer for lit and examples.

This PR migrated codes that are currently in AFFiNE codebase. We free like it is the time to move into blocksuite.

  1. react wrapper: add a custom createReactComponentFromLit that is similar to createComponent from @lit/react. This was added to mitigate issues that web components in blocksuite are often instantiated via creating web components & appending to dom directly in JS, described in [react] Property values are not available in the connectedCallback when using createComponent from @lit/react lit/lit#4435
  2. react-lit portal: that makes it easier to convert React element into Lit (TemplateResult). Original PR: refactor(component): render react element into lit AFFiNE#6124
  3. examples: like the react-basic example, but re-mastered with the React adapters fragments + demo for react-lit portal
Kapture.2024-03-18.at.18.57.28.mp4

Copy link

vercel bot commented Mar 15, 2024

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

Name Status Preview Comments Updated (UTC)
blocksuite ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 21, 2024 6:07am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
blocksuite-docs ⬜️ Ignored (Inspect) Visit Preview Mar 21, 2024 6:07am

@pengx17 pengx17 changed the title feat: react adapters (wip) feat: react adapters Mar 15, 2024
@pengx17 pengx17 requested review from doodlewind and EYHN March 18, 2024 10:55
@pengx17 pengx17 changed the title (wip) feat: react adapters feat: react adapters Mar 18, 2024
@pengx17 pengx17 marked this pull request as ready for review March 18, 2024 10:56
{
"name": "@blocksuite/react",
"version": "0.12.0",
"description": "Lit renderer for blocksuite store",
Copy link
Member

Choose a reason for hiding this comment

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

"Lit renderer?" 👀

I'm not sure if this package should belong to framework, since it may be used to wrap preset components like editors and fragments. /cc @Saul-Mirone

Copy link
Contributor Author

pengx17 commented Mar 21, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @pengx17 and the rest of your teammates on Graphite Graphite

Copy link
Collaborator

@Saul-Mirone Saul-Mirone left a comment

Choose a reason for hiding this comment

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

The view store refactor will have huge influence on framework integration, we'll need to wait for the feature landed.

@Saul-Mirone
Copy link
Collaborator

Closing after discussion. A new react adapter will be introduced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants