Skip to content

feat(mitosis): code gen support for named slots #1334

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

Merged
merged 6 commits into from
Jan 24, 2024
Merged

Conversation

mrkoreye
Copy link
Collaborator

@mrkoreye mrkoreye commented Jan 24, 2024

Description

This PR adds support for named slots in custom component code gen: https://www.loom.com/share/f3ad5eee72f9486a9130ce1f09ceafa0

Fixes #1301

Copy link

vercel bot commented Jan 24, 2024

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

Name Status Preview Comments Updated (UTC)
mitosis-fiddle ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 24, 2024 8:03pm

Copy link

nx-cloud bot commented Jan 24, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit f269461. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 4 targets

Sent with 💌 from NxCloud.

@mrkoreye mrkoreye marked this pull request as ready for review January 24, 2024 04:59
@mrkoreye mrkoreye requested a review from samijaber as a code owner January 24, 2024 04:59
@@ -15,4 +15,5 @@ export interface ToReactOptions extends BaseTranspilerOptions {
*/
contextType?: 'context' | 'prop-drill';
addUseClientDirectiveIfNeeded?: boolean;
noPrefixSlots?: boolean;
Copy link
Contributor

Choose a reason for hiding this comment

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

Given #1301, I think we want the default to be not prefixing.

Would you mind switching this to:

Suggested change
noPrefixSlots?: boolean;
prefixSlots?: boolean;

and only prefixing if the option was explicitly provided?

This will require updating the snapshot tests, which you can do by running:

  • yarn ci:build in the root, and then
  • yarn snapupdate in package/core

Copy link
Contributor

Choose a reason for hiding this comment

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

Scratch that: if you don't mind, completely remove the prefixing logic altogether! We don't need it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

👍

@mrkoreye
Copy link
Collaborator Author

@samijaber updated tests and readme to reflect new slot behavior

Copy link
Contributor

@samijaber samijaber left a comment

Choose a reason for hiding this comment

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

nice 👍🏽

@samijaber samijaber merged commit 3569a7b into main Jan 24, 2024
@samijaber samijaber deleted the korey/add-named-slots branch January 24, 2024 20:53
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.

React named slots getting prefixed with the word 'Slot'
2 participants