Use `clientOnly` without isolating component in its own file
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 426
- Avg merge
- 1d 3h
- Merged PRs (30d)
- 11
Description
What is this request related to?
Request
📋 Suggested
https://docs.solidjs.com/solid-start/reference/client/client-only
📋 General description or bullet points
Provide a way of using clientOnly without creating a separate file.
Code wise, this could be more ergonomic.
Could also create a helper function to directly translate component function to client only component.
import { clientOnly } from "@solidjs/start"
function ClientOnlyComponent() {
const location = window.document.location
return <div>{location.href}</div>
}
type ResolveClientComponent = (value: {
default: Component
}) => void
export default clientOnly(
() =>
new Promise((resolve: ResolveClientComponent) => {
resolve({ default: ClientOnlyComponent })
}),
)
🖥️ Reproduction of code samples in StackBlitz
StackBlitz doesn't support solid-start
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the clientOnly reference at https://docs.solidjs.com/solid-start/reference/client/client-only and inspect the existing clientOnly entry point. Determine how an inline component or helper could be supported without a separate file, then verify that the documented usage works without StackBlitz. Done means the requested ergonomic form is defined and supported by the API.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100