Skip to content

Preact: Remove use of JSX#32953

Merged
ndelangen merged 4 commits into
storybookjs:nextfrom
43081j:preact-import-source
Nov 11, 2025
Merged

Preact: Remove use of JSX#32953
ndelangen merged 4 commits into
storybookjs:nextfrom
43081j:preact-import-source

Conversation

@43081j
Copy link
Copy Markdown
Contributor

@43081j 43081j commented Nov 5, 2025

To get rid of the ts-expect-error, we can set the import source as
preact so it will resolve preact's Component rather than React's.

Checklist for Contributors

Testing

Existing tests should cover this change.

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

Ensure that any preact stories still render.

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook publish.yml --field pr=<PR_NUMBER>

Summary by CodeRabbit

  • Refactor
    • Modernized internal rendering implementation while maintaining functionality.

To get rid of the ts-expect-error, we can set the import source as
preact so it will resolve preact's `Component` rather than React's.
@nx-cloud
Copy link
Copy Markdown

nx-cloud Bot commented Nov 5, 2025

View your CI Pipeline Execution ↗ for commit 5aab9c0

Command Status Duration Result
nx run-many -t build --parallel=3 ✅ Succeeded 51s View ↗

☁️ Nx Cloud last updated this comment at 2025-11-10 15:27:44 UTC

@valentinpalkovic valentinpalkovic changed the title chore(renderers/preact): set preact as import source Preact: set preact as import source Nov 10, 2025
@valentinpalkovic valentinpalkovic added bug preact ci:normal Run our default set of CI jobs (choose this for most PRs). labels Nov 10, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 10, 2025

📝 Walkthrough

Walkthrough

Single file converted from JSX syntax to hyperscript function calls in the Preact renderer. Replaced component rendering invocation from <Component {...args} /> to h(Component, args) and removed associated TypeScript error suppressions while maintaining equivalent runtime behavior.

Changes

Cohort / File(s) Summary
Preact renderer JSX to hyperscript conversion
code/renderers/preact/src/render.tsx
Refactored component rendering from JSX syntax to hyperscript h() function call; removed two preceding ts-expect-error comments. Runtime behavior unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

✨ Finishing touches
  • 📝 Generate docstrings

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between af0cfa7 and 5aab9c0.

📒 Files selected for processing (1)
  • code/renderers/preact/src/render.tsx (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • code/renderers/preact/src/render.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
  • GitHub Check: normal
  • GitHub Check: Danger JS
  • GitHub Check: Core Unit Tests, windows-latest

Comment @coderabbitai help to get the list of available commands and usage tips.

@ndelangen ndelangen changed the title Preact: set preact as import source Preact: Remove use of JSX Nov 10, 2025
@ndelangen ndelangen added cleanup Minor cleanup style change that won't show up in release changelog and removed bug labels Nov 10, 2025
@ndelangen ndelangen merged commit 07e8036 into storybookjs:next Nov 11, 2025
57 checks passed
@43081j 43081j deleted the preact-import-source branch November 11, 2025 10:16
@github-actions github-actions Bot mentioned this pull request Nov 11, 2025
12 tasks
@bennypowers
Copy link
Copy Markdown
Contributor

I saw "remove use of JSX" and got all excited then it turned out to be a config PR 😆

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:normal Run our default set of CI jobs (choose this for most PRs). cleanup Minor cleanup style change that won't show up in release changelog preact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants