docs: add building-for-mobile guide - #1640
OneEyed1366 wants to merge 2 commits into
Conversation
|
|
✅ Deploy Preview for solid-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
@LadyBluenotes ready for review whenever you have bandwidth - all checks are green. ☕ |
LadyBluenotes
left a comment
There was a problem hiding this comment.
Really good start and thank you for taking this on!
Do you mind expanding a bit on some parts? It still feels like there's only two options for the renderer and I think it would benefit from expanding a bit. We don't need it to explain everything in detail, but providing more context can be helpful for people in helping make decisions.
| or Tauri, or by driving real native views with solid-js/universal. | ||
| --- | ||
|
|
||
| Solid doesn't ship a mobile renderer, but three routes get a Solid app onto iOS and Android: keep rendering through the DOM (a WebView, or a DOM shim over native views), or drive native views directly with Solid's custom-renderer API. |
There was a problem hiding this comment.
| Solid doesn't ship a mobile renderer, but three routes get a Solid app onto iOS and Android: keep rendering through the DOM (a WebView, or a DOM shim over native views), or drive native views directly with Solid's custom-renderer API. | |
| There are three routes get to shipping Solid on iOS and Android: continue rendering through the DOM through a WebView, or a DOM shim over native views; or drive native views directly with Solid's custom-renderer API. |
| --- | ||
|
|
||
| Solid doesn't ship a mobile renderer, but three routes get a Solid app onto iOS and Android: keep rendering through the DOM (a WebView, or a DOM shim over native views), or drive native views directly with Solid's custom-renderer API. | ||
| [`solid-native`](https://github.com/tjjfvi/solid-native), listed on solidjs.com's [Resources](https://www.solidjs.com/resources) page, is flagged `maintained: false` there; the options below are the current routes. |
There was a problem hiding this comment.
I'm not entirely sure this is something needed to be said, maybe you can remove it?
| or Tauri, or by driving real native views with solid-js/universal. | ||
| --- | ||
|
|
||
| Solid doesn't ship a mobile renderer, but three routes get a Solid app onto iOS and Android: keep rendering through the DOM (a WebView, or a DOM shim over native views), or drive native views directly with Solid's custom-renderer API. |
There was a problem hiding this comment.
I did rewrite this, but I feel like expanding a bit on the 3 options (because how it's written right now sounds like you're only mentioning two). Maybe worth mentioning it in a list and briefly saying something like:
- Using a webview (via libs like Capacitor / Tauri)
- Option 2
- Option 3
|
|
||
| ## Keeping the DOM renderer | ||
|
|
||
| Capacitor and Tauri wrap a regular Solid [SPA](/solid-router/rendering-modes/spa) in a native WebView. NativeScript shims a DOM-like API over its own native views instead. |
There was a problem hiding this comment.
Could you expand a bit on what a webview is before explaining the options. Might also be worth mentioning the differences in capacitor / tauri / nativescript before expanding them individually
| ## Keeping the DOM renderer | ||
|
|
||
| Capacitor and Tauri wrap a regular Solid [SPA](/solid-router/rendering-modes/spa) in a native WebView. NativeScript shims a DOM-like API over its own native views instead. | ||
| Either way, your Solid app, styling, and `solid-js/web` renderer stay unchanged. |
There was a problem hiding this comment.
Could you add this to the intro? That way we make sure it's not buried?
| Solid doesn't ship a mobile renderer, but three routes get a Solid app onto iOS and Android: keep rendering through the DOM (a WebView, or a DOM shim over native views), or drive native views directly with Solid's custom-renderer API. | ||
| [`solid-native`](https://github.com/tjjfvi/solid-native), listed on solidjs.com's [Resources](https://www.solidjs.com/resources) page, is flagged `maintained: false` there; the options below are the current routes. | ||
|
|
||
| ## Keeping the DOM renderer |
There was a problem hiding this comment.
Would it make sense to add a table comparing the features each have / why you would want one over the other? As it stands, it's difficult to know why you would pick one over another and introducing a scannable table can help people make a decision.
Then the sections themselves can dive a bit more into the benefits of one option vs the others
|
|
||
| [`@nativescript-community/solid-js`](https://github.com/nativescript-community/solid-js) shims a DOM-like API over [NativeScript](https://nativescript.org/)'s native views, so Solid's regular DOM renderer targets real native views with no WebView involved. | ||
|
|
||
| :::note |
There was a problem hiding this comment.
This would be something that would be nice to put in a table (again showing features one lib offers vs others)
|
|
||
| ## Native views with `solid-js/universal` | ||
|
|
||
| Solid ships a framework-level custom-renderer API in `solid-js/universal`. |
There was a problem hiding this comment.
Briefly explain why this is necessary
| }); | ||
| ``` | ||
|
|
||
| This lets a renderer drive Solid's fine-grained reactivity against any tree-shaped host, not just the DOM, with no dependency on `solid-js/web`. |
There was a problem hiding this comment.
Is there a reason there needs to be an explicit callout to not need solid-js/web?
| This lets a renderer drive Solid's fine-grained reactivity against any tree-shaped host, not just the DOM, with no dependency on `solid-js/web`. | ||
| `createRenderer` only gets you as far as creating and updating nodes on that host. None of a platform's native views, layout engine, or gesture handling comes with it, so building on it directly is a project of its own. | ||
|
|
||
| Two projects build on it today. [SolidTV](https://github.com/solid-tv/solid) targets [LightningJS](https://lightningjs.io/), the WebGL renderer used by TV apps at Angel Studios and Bell Fibe TV. |
There was a problem hiding this comment.
Can we leave out mentioning existing projects, please? Adds a bit of maintenance burden (we should leave this as a guide)
Description(required)
Adds a "Building for mobile" guide under Guides, closing the docs gap in #1636: there was no answer to "can I build a mobile app with Solid?" and
solid-js/universal(createRenderer) had no mention anywhere in the docs.Covers three routes:
solid-js/universal— thecreateRendererAPI, with SolidTV and Symbiote Native as production examplesAlso notes
solid-nativeis deprecated — flaggedmaintained: falseon solidjs.com's Resources page, per the issue's own data point.Related issues & labels
solid-js/universal) - the docs have no answer to "can I build a mobile app with Solid?" #1636