tauri-apps / tauri-docs

The source for all Tauri project documentation.
https://tauri.app
MIT License
778 stars 567 forks source link

[request] Demo App Tutorial #2660

Open ezra-en opened 1 week ago

ezra-en commented 1 week ago

Question you want answered

How and Why do I set up my Tauri App this way?

Where did you look for an answer?

I went through the documentation flow, skipping the options I wasn't looking for (like Yew, for example) until I got to the next major section of progress.

Page URL

No response

Additional context

I believe there is some value in providing a 0-to-1 app development tutorial, walking through why we make decisions in setup, and what the "blessed way" is in terms of implementing features using tauri's APIs (e.g. "what are permissions and why do I need to add them like this?", which gives us the opportunity to provide logical context for the system.)

Are you willing to work on this yourself?

ezra-en commented 1 week ago

Building off the barebones structure laid out in @simonhyll's todo-app PR, I do believe having a tutorial walking through the decision-making logic for implementing something of reasonable complexity like a Todo app would be valuable to demonstrate Tauri APIs in contrast to web frameworks without Tauri.

vasfvitor commented 1 week ago

great idea!

let's flesh out your idea. In terms of "steps", where it would start, ..., and, end? Just generally what's on your mind?

what decisions/Tauri plugin/api you intend to use?

Do you already have the finished app you intend to create the demo for?

In discord you mentioned doing it with Svelte. I think it's fine (even the sample app at plugins-workspace uses svelte), can you see it done in a way that we could later swap Svelte -> React, or whatever, easily. I think using ts, it would get too much in the way

ezra-en commented 1 week ago

I had a whole thing written up and then my computer went into a bad state so here we go again:

I don't currently have a finished app, but I've used the things I'm thinking to teach across many different projects.

Re: svelte, yeah we can do it framework agnostically i guess? state management varies a little across frameworks but it's possible i think.

re: TS, why would TS get in the way?

vasfvitor commented 1 week ago

Moving on to tauri-plugin-sql. (not too sure about this because drizzle is quite annoying to integrate but anyway, maybe once the plugin DX gets better?)

what about raw queries?

why would TS get in the way?

My opinion is because in the end to have the features a ui framework has, one would end up writing a micro framework, so many parts of the tutorial would be copy pasting code that would be embedded/abstracted in a ui framework. It's not that specifically ts would get in the way, but the frontend development, and for a longer tutorial I'm not sure this is good.

Of course this may not be the case once the app is done and we see all the parts together, and that's why I'm suggesting to make js framework agnostic, so that the frontend details are just that, details, that one can see it and swap as needed (assuming vite + ?)

Related: Have you seen this poll/discussion on Tauri discord?

Should the labs in the new v2 "Learn" category be made with or without frontend frameworks? On the one hand vanilla JS is more universally applicable, on the other hand labs are easier to make and follow if frameworks are used, and can act as tips for how to do things in them.

https://discord.com/channels/616186924390023171/1232318266542915617/1238447879362969661

ezra-en commented 6 days ago

raw queries are something I've considered, yes. for a todo app, this is completely doable.

re: framework agnosticism, that really depends on who we're catering to and I think we might be catering to different audiences with our ideas? Please correct me if I misunderstood your point.

To write a tutorial with raw Vite doesn't make sense to me for the same reason you mentioned, I'd essentially be reimplementing things like state management when Svelte already has that available for me. However, things like state management are all implemented to some degree in most frameworks available (Signal implementations being more popular across the board, I would be using Svelte 5's equivalent, Runes.) and to go without a framework doesn't make sense if my audience is just starting out and wants to see an easily grokkable, ergonomic, "golden" setup that teaches them the concepts at hand in a Tauri environment. People who already know these base concepts will most likely understand how to transfer them to other frameworks, reducing the need for a framework agnostic tutorial by itself imo. And your linked poll, I didn't see it but that most people approved including some kind of framework supports my point (apologies in advance if I misunderstood yours.)

For educational purposes, I wouldn't go with React despite it's sheer popularity. My proposed audience is new beginners who might know a little bit about web development who want to see how their webdev skills can transfer over to desktop software. Teaching "Reactisms" is not in their interest imo, and I believe teaching Svelte as their first metaframework (?) is more in their interest, assuming that Svelte would teach concepts more idiomatically to the web with just enough affordances to make learning modern concepts like signal-based state and components pleasant.

Again, apologies if I misunderstood your point. Frontend is a big part of software development imo, and it's the direction I'm coming from, so I don't understand why I should be minimising it? Tauri's attractiveness is not popularly in relevance to the Rust backend (and I'm not qualified to be teaching that part anyway,) it's in how it supports every web framework out there, increasing the pool of applicants, so to speak. In doing so, it removes a lot of what made these web frameworks popular, the "full-stack" aspect, and reduces it down to a front-end only static site. While this is an inherent limitation (until we integrate some sort of JS runtime into Tauri) this is also an frequently misunderstood aspect of Tauri, judging by the frequency of people coming into the Discord complaining that node APIs don't work like they expect. My aim with this tutorial is to define Tauri as it's own "desktop runtime" rather than building off of the majority of frontend framework tutorials where Node is assumed, which means I'm primarily catering to frontend people in the end, not Rust backend people.

ezra-en commented 6 days ago

Been thinking about how this might be better as a full-fledged series

Again, the Learn section may not be the right place to put something as large as that? But I don't know where else I could place it within the Tauri scope?

This still fits fairly in scope for a tutorial, for people to gain basic competence.

vasfvitor commented 6 days ago

My proposed audience is new beginners who might know a little bit about web development who want to see how their webdev skills can transfer over to desktop software.

I was one of those beginners when I first tried Tauri waaay back and I failed miserably to do anything with it.

For educational purposes, I wouldn't go with React despite it's sheer popularity

Agree

Been thinking about how this might be better as a full-fledged series

It would be easier to start writing, review and to digest, as a reader.

Again, the Learn section may not be the right place to put something as large as that

It could be on Learn > Build a To do App > Getting Started | Design | ... anyways this doesn't matter now. Let's do it