tauri-docs icon indicating copy to clipboard operation
tauri-docs copied to clipboard

[docs] I just went through the quickstart and noticed a few issues

Open paustint opened this issue 1 year ago • 3 comments

I ended up having to start over because I followed the guide which led me astray.

I was following https://tauri.app/v1/guides/getting-started/setup/vite

I started with yarn create tauri-app

  • Create the Rust Project -> this was already done as part of yarn create tauri-app, so when I attempted to do this I got an error saying that the src-tauri directory was not empty and I did a force install as suggested. Instead all I really needed to do was edit tauri.conf.json and change the port (but I was not sure if other stuff would have been different, which is why I opted for force the first time)
    • In addition, the instructions to update src-tauri/tauri.conf.json do not honor yarn/npm/pnmp configuration
  • This command offered to add @tauri-apps/api for me (and I accepted), so I did not need to explicitly do this step called out in the docs

Also, on the Development Cycle page - this is called out:

In your project repository, you SHOULD commit the "src-tauri/Cargo.lock" along with the "src-tauri/Cargo.toml" to git because Cargo uses the lockfile to provide deterministic builds. As a result, it is recommended that all applications check in their Cargo.lock. You SHOULD NOT commit the "src-tauri/target" folder or any of its contents.

Ideally the cli would manage this by default for projects structured in the standard way - src-tauri/target should be added to .gitignore by default since the cli generated the file to start with.

paustint avatar Jul 17 '22 14:07 paustint

Just to clear it up a bit. The docs currently mainly describe how to set it up without create-tauri-app (that's why it also shows how to use create-vite). So really, the only somewhat valuable information here is the example vite config, which is not necessary for using vite with tauri. But i guess we need to make that clearer than just the small infobox at the top (which doesn't even mention that specifically).

Ideally the cli would manage this by default for projects structured in the standard way - src-tauri/target should be added to .gitignore by default since the cli generated the file to start with.

It is managed automatically, there is a .gitignore file in the src-tauri dir, the comment is there so that people don't add the Cargo.lock file themselves.

Thanks for the feedback btw!

FabianLars avatar Jul 17 '22 17:07 FabianLars

Reading through the create-tauri-app callout at the top I guess we don't do a good job explaining that it's an ALTERNATIVE to manually setting up tauri with the rest of the guide. So we can do some work to update the phrasing to highlight that.

lorenzolewis avatar Jul 19 '22 11:07 lorenzolewis

..You SHOULD NOT commit the "src-tauri/target" folder or any of its contents.

It is managed automatically, there is a .gitignore file in the src-tauri dir, the comment is there so that people don't add the Cargo.lock file themselves.

Ah - for some reason I could have sworn src-tauri/target showed up in git, but I just started over again and realized that was not the case - sorry for the noise on that 😄

paustint avatar Jul 20 '22 00:07 paustint

I just followed the https://tauri.app/v1/guides/getting-started/setup/html-css-js and was baffled to find, after running create-tauri-app, that the rust step failed. I had assumed they were part of the same sequence, rather than alternative ways of doing the same thing. Perhaps just moving the "Tip" to the end of the page will make it clear. It does make me wonder then why you even have instructions to achieve the same thing in a way people won't use? Why not just make the setup guide use create-tauri-app and then use and explain the generated source in the rest of the guide? It is a "getting started" guide. You could do the long way in the "next step" or later guide step, or as an addendum.

jayber avatar Aug 30 '22 16:08 jayber

This is such a good point. I think we need to differentiate between the approaches better.

nothingismagick avatar Aug 30 '22 16:08 nothingismagick

Thanks for the feedback @paustint and @jayber, we've updated the phrasing in the annotation at the top of the pages:

Screenshot 2022-09-10 at 14 12 07

The content in the guides roughly line up with the output of create-tauri-app for a chosen framework so we added a line to recommend the reader to read through the rest of the guide to understand what create-tauri-app has done for them and to also understand the setup of the scaffolded project.

lorenzolewis avatar Sep 10 '22 13:09 lorenzolewis