Skip to content

docs: add FAQ about mobile apps #12761

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

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions documentation/docs/05-misc/01-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ If you need hash-based routing on the client side, check out [svelte-spa-router]

You can see a [community-maintained list of routers on sveltesociety.dev](https://sveltesociety.dev/packages?category=routers).

## How do I write my mobile app?

The [most popular solution](https://bitrise.io/blog/post/the-state-of-mobile-app-development-in-2022) for building mobile apps is to use the Android and iOS SDKs directly, which makes building a mobile app completely independent of which JavaScript framework you use. Similarly, the cross-platform Flutter library, which uses the Dart programming language, is very popular as well and [often preferred to other solutions](https://survey.stackoverflow.co/2024/technology/#2-other-frameworks-and-libraries).
Copy link
Member

Choose a reason for hiding this comment

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

this seems like a very weird paragraph to include in the Svelte docs. Surely in the context of this FAQ, 'How do I write my mobile app?' means 'How do I write my mobile app with Svelte?'

Copy link
Member Author

@benmccann benmccann Aug 10, 2024

Choose a reason for hiding this comment

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

yeah, I can see that. I was trying to address folks that would point at React Native by noting that usually you're not using JS to write a mobile app anyway. And while I'd like to highlight that solutions exist in Svelte, I honestly can't say I'd recommend them at this point

Maybe there's a better way to word it?

Copy link
Member

Choose a reason for hiding this comment

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

Do we still want this PR? If there's nothing we want to recommend then maybe we don't need to say anything. If we do want this FAQ answered then the answer should probably mention Tauri

Copy link
Member Author

Choose a reason for hiding this comment

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

I still think this is helpful. It's a complex ecosystem of different solutions and it helps people to provide some pointers and things to consider. Though the Svelte Native part might need to be updated

I looked at Tauri when writing this and it was completely impossible to write a mobile app in it. Even today I can't find any docs on how to actually do that. They even seem to acknowledge some of the short-comings here: https://v2.tauri.app/blog/tauri-2-0-0-release-candidate/#the-road-to-stable-and-beyond

Copy link
Member

Choose a reason for hiding this comment

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

I mean, the RC blog post you linked to says this

we want to make clear that you can develop production ready mobile applications with Tauri NOW

and https://v2.tauri.app/start/ says this

Tauri is a framework for building tiny, fast binaries for all major desktop and mobile platforms.

so while I haven't personally done so it definitely seems like you should be able to (and Thilo Maier and Daniel Mader gave a talk on combining Tauri and SvelteKit at the last Svelte Summit, though they found some drawbacks).

Anyway, if you're still keen to get this in then let's ditch the first and last paragraphs, and point it at main

Copy link
Member Author

Choose a reason for hiding this comment

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

Unless I missed them, there are literally zero docs for tauri mobile. Do we really want to tell people about something with no docs? Or can you find the docs?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

I mean there are no mobile docs. That page doesn't mention anything about mobile. I guess I could mention something at the end about Tauri, but I'll caveat it quite heavily that it's in development, there are no docs, and you need to find your own way

Copy link
Member

Choose a reason for hiding this comment

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

dev: https://v2.tauri.app/develop/#developing-your-mobile-application
distribute:
android: https://v2.tauri.app/distribute/google-play/
ios: https://v2.tauri.app/distribute/app-store/

i havn't tried it and the docs menu is a bit confusing to me but as far as i understand tauri v2 does support mobile apps and there are docs for it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, cool. This is way better than what they had when I originally authored the PR and those pages were essentially TODOs. Their site search is really terrible. If you type "mobile" it doesn't come up. I'll file an issue to see if they can make it a bit easier to find


If you'd like to leverage your existing Svelte components and knowledge of Svelte when building mobile apps, you can turn a [SvelteKit SPA](https://kit.svelte.dev/docs/single-page-apps) into a mobile app with [Capacitor](https://capacitorjs.com/solution/svelte). Mobile features like the camera, geolocation, and push notifications are available via [plugins](https://capacitorjs.com/docs/plugins).

Finally, Svelte Native lets you write NativeScript apps using Svelte components containing [NativeScript UI components](https://docs.nativescript.org/ui/) rather than DOM elements, which may be familiar for users coming from React Native.

## Can I tell Svelte not to remove my unused styles?

No. Svelte removes the styles from the component and warns you about them in order to prevent issues that would otherwise arise.
Expand Down
Loading