Skip to content

feat(create-rslib): add Solid template and related documents - #1731

Merged
Timeless0911 merged 40 commits into
mainfrom
feat/solid-template
Jul 8, 2026
Merged

feat(create-rslib): add Solid template and related documents#1731
Timeless0911 merged 40 commits into
mainfrom
feat/solid-template

Conversation

@elecmonkey

@elecmonkey elecmonkey commented Jun 30, 2026

Copy link
Copy Markdown
Member

Summary

Add a Solid template to create-rslib.

The template builds a Solid component library with dual ESM outputs:

  • import points to compiled JavaScript
  • solid points to preserved JSX source
  • TypeScript template emits declaration files

This also adds Solid guide docs.

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Add template-solid-ts and template-solid-js with:
- Dual output: compiled .js via pluginSolid + preserve .jsx with "solid" condition
- Button component, CSS, and tests using @solidjs/testing-library
- rstest + happy-dom test setup
- TypeScript config with jsx: preserve and jsxImportSource: solid-js
- Add 'solid-js' and 'solid-ts' to TEMPLATES array
- Add Solid option to interactive template selector
- Add Solid-specific assertions in test helper (plugin deps, exports, peer deps)
- Add CASES_SOLID test cases and parseTemplateName assertions
Add English and Chinese documentation covering:
- Project creation with create-rslib
- Plugin setup (pluginBabel + pluginSolid)
- Dual output with "solid" export condition
- TypeScript and SSR configuration
The second lib entry for source JSX output needs two settings:
- `jsc.transform.react.runtime: 'preserve'` to prevent SWC from compiling JSX
- `module.parser.javascript.jsx: true` to let Rspack's parser accept JSX syntax

Without these, SWC defaults to React JSX transform, producing
`React.createElement` calls instead of preserved JSX.

Also updates EN/ZH docs to explain the dual-output configuration in detail.
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jun 30, 2026

Copy link
Copy Markdown

Deploying rslib with  Cloudflare Pages  Cloudflare Pages

Latest commit: c1d8dae
Status: ✅  Deploy successful!
Preview URL: https://36c2b901.rslib.pages.dev
Branch Preview URL: https://feat-solid-template.rslib.pages.dev

View logs

Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx
@elecmonkey
elecmonkey marked this pull request as ready for review June 30, 2026 08:43
Copilot AI review requested due to automatic review settings June 30, 2026 08:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Timeless0911

Copy link
Copy Markdown
Contributor

Add an example later after this pr merged.

Comment thread packages/create-rslib/test/helper.ts Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx
Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx
Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
Remove the separate `dist/source` subdirectory for the preserved JSX
output. Both compiled (.js) and source (.jsx) files now coexist in
`dist/`, simplifying the package structure and exports field.
Comment thread packages/create-rslib/template-solid-js/rslib.config.js Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
Comment thread website/docs/zh/guide/solution/solid.mdx Outdated
@elecmonkey
elecmonkey requested a review from Timeless0911 July 8, 2026 03:53
@Timeless0911

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

# Conflicts:
#	packages/create-rslib/test/helper.ts

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Resolved the merge conflict in packages/create-rslib/test/helper.ts. The conflict was due to the env.d.ts check block being removed on main while our branch added solid to it. I accepted main's change (removing the block) and also removed the env.d.ts file from template-solid-ts/src/ to align with the other templates.

@Timeless0911
Timeless0911 merged commit bd419e8 into main Jul 8, 2026
11 checks passed
@Timeless0911
Timeless0911 deleted the feat/solid-template branch July 8, 2026 05:52
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.

4 participants