Skip to content
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

Welcome chapter #176

Merged
merged 44 commits into from
Feb 10, 2022
Merged

Welcome chapter #176

merged 44 commits into from
Feb 10, 2022

Conversation

alice-i-cecile
Copy link
Member

@alice-i-cecile alice-i-cecile commented Jun 16, 2021

Welcome to the Welcome Chapter! This is good to go now from my perspective :) The code sample embedding can be a seperate PR: I'd rather not block forever on that.

TODO:

Copy link
Contributor

@Nilirad Nilirad left a comment

Choose a reason for hiding this comment

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

Found some typos + some observations.

content/learn/book/welcome/plugins/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/plugins/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/plugins/_index.md Outdated Show resolved Hide resolved
Copy link
Contributor

@Nilirad Nilirad left a comment

Choose a reason for hiding this comment

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

Round two 😝. Good job, as always.

The structure of the chapter looks good to me, especially since the addition of the App section.

The level of communication could be improved though. In many points the book explains the details of the engine, while the Diátaxis Framework states:

[Explanation is] not a close-up view of the machinery, like reference material. [...] This allows explanation to become discussion, a more relaxed, freer way to consider something. Explanation joins things together. It’s documentation that it makes sense to read while away from the product itself.

I think this happens primarily because the API docs are quite neglected. So, I was thinking: since the next days I'm not extra busy, maybe I can open a parallel PR draft on bevy to enrich the API docs in the points where they are referenced by the book.

content/learn/book/welcome/app/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/installation/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/plugins/_index.md Outdated Show resolved Hide resolved
@alice-i-cecile
Copy link
Member Author

The structure of the chapter looks good to me, especially since the addition of the App section.

Agreed. This helps dramatically.

So, I was thinking: since the next days I'm not extra busy, maybe I can open a parallel PR draft on bevy to enrich the API docs in the points where they are referenced by the book.

That sounds useful, thanks.

@Nilirad
Copy link
Contributor

Nilirad commented Jun 20, 2021

I don't know if you already know it, but you can link the source to docs.rs instead of GitHub.

Example: https://docs.rs/bevy_internal/latest/src/bevy_internal/default_plugins.rs.html#3

@alice-i-cecile
Copy link
Member Author

Hmm. The docs.rs source links are interesting. I'm not sure if I like them more or less than the GitHub links. They're more idiomatic, but make it harder to explore related code.

@Nilirad
Copy link
Contributor

Nilirad commented Jun 20, 2021

I found a couple of pitfalls with the docs.rs source links, that can be fortunately avoided:

  1. They relate to lines of code, so if the file gets updated the link may become outdated. (We can avoid this by just linking to the docs.rs page instead of directly to the source. This will also make easy to explore the source code of related items).
  2. Subcrates don't have the src link (This can be solved by linking to the original crate docs, e.g. bevy_app for App)

Solving issue number 2 limits the docs navigation to only the subcrate though. This may not be a huge issue but it will be a bit frustrating for the user that has to manually go to docs.rs and select the main bevy crate to see stuff on other crates. This can be solved by hosting the docs on the website and building them with dependencies (which is by default). This will put on us some responsibility, but the benefits of having the complete docs outweights the cost IMO.

Example of self-hosted API docs: Looks like it's possible to limit documenting dependencies to the local crates 🤔.

@alice-i-cecile
Copy link
Member Author

For 2, this is why I'm careful to link to the original definition :) Do you think it's better to link to docs.rs over GitHub then?

@Nilirad
Copy link
Contributor

Nilirad commented Jun 20, 2021

To me, it looks better and it's more tightly coupled with the docs. The important thing though, is that we link to the API item and not the lines of code. Otherwise, we should manually check each link at each update to ensure it's still updated.

content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/app/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/app/_index.md Outdated Show resolved Hide resolved
Copy link
Contributor

@mirkoRainer mirkoRainer left a comment

Choose a reason for hiding this comment

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

OK. I read through this and made some opinion comments. Please let me know if they're way off.

content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/app/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/app/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/app/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/plugins/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/plugins/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/plugins/_index.md Outdated Show resolved Hide resolved
@alice-i-cecile alice-i-cecile marked this pull request as ready for review August 6, 2021 20:00
@cart cart force-pushed the new-book branch 2 times, most recently from 04bc036 to 477268e Compare August 6, 2021 21:29
@alice-i-cecile
Copy link
Member Author

Happy to discuss any/all of these changes. It just seemed faster to make them inline instead of having a long back and forth explaining what I want.

Yep, I'm perfectly content to have you do tweaks like that directly :)

While Bevy's modular architecture makes it relatively easy to integrate your own (or third-party) solutions, be mindful that Bevy does not provide a complete game solution out of the box *yet*.
[Contributions to the engine](https://github.com/bevyengine/bevy/) are extremely welcome, but if you want something fully-featured to make your dream game *today*, check out [Godot](https://godotengine.org/) instead!

Unsurprisingly, Bevy's rapid pace of development means that our APIs will break, repeatedly, in both deep and pervasive ways.
Copy link

Choose a reason for hiding this comment

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

One thing to consider: Rust is often considered to be in line with "if it compiles, it works" - however, I think bevy is not matured there yet. Maybe a good to mention in docs?

(920+ unwrap() or panic!'s in code currently - I've personally been caught by a surprise few times to runtime crashes)

Copy link
Member Author

Choose a reason for hiding this comment

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

That's probably a good caveat. Compared to other game engines, it's surprisingly "if it compiles it works". But much less so for people coming to games from the Rust ecosystem!

Copy link
Member

Choose a reason for hiding this comment

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

I think "if it compiles, it works" is an unrealistic goal because Rust's static guarantees are just a subset of its capabilities. I also don't think that "number of unwraps" is a particularly good measure of code maturity. There are plenty of cases where the only real option is an internal unwrap.

That being said, except in a few specific cases, Bevy internals shouldn't crash from normal "userspace" code (and they do currently in a number of cases).

Its worth calling out that Bevy currently has more rough edges / bugs / crashes than a stable product would. However this page is also the first thing Bevy users will see and I consider it a key part of "Bevy marketing". We should do it in a way that doesn't (1) scare people away or (2) give the wrong impression about our goals and priorities. Feel free to add a line here, but (as I've already warned @alice-i-cecile) I have a lot of very specific goals for this page and I'll probably follow this pr up with a lot of changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

except in a few specific cases

Are these cases outlined elsewhere? While I agree that they shouldn't be listed on the first welcome page, perhaps a link to the "rough edges" would be appropriate.

Copy link

Choose a reason for hiding this comment

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

There was good discussion in Discord about the unwrap's as well yesterday. I agree that there will be unwraps, and some of them are totally okay as well (e.g. when starting app, during development work). Also, of the 920+ quite many seemed to be in the tests code, which I did not consider when grepping.

Good point about the marketing, maybe the extra warning should not be yet - the section header "Stability warning" already gives a hint about it.

Also, over time the runtime panic's will get lower and lower. However, I would still be very mindful of this, since an unanticipated runtime panic at wrong point (e.g. demo time, or in production) will quickly turn new adopters away.

Copy link
Member

Choose a reason for hiding this comment

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

Are these cases outlined elsewhere? While I agree that they shouldn't be listed on the first welcome page, perhaps a link to the "rough edges" would be appropriate.

They are not. It will be hard to maintain the list unless it integrates directly with the issue tracker. Maybe we should have a label for "UX speedbumps". We can link to that specific label. And that way whenever we resolve an issue, the list is automatically updated.

content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/apps/_index.md Outdated Show resolved Hide resolved
@cart
Copy link
Member

cart commented Aug 13, 2021

After handling @mirkoRainer's comments, I think we can probably merge this. Gotta start moving forward and we can always iterate on this later.

@alice-i-cecile
Copy link
Member Author

Done! I'm not thrilled with the new example (it mostly duplicates the line above and will spam the user's console), but we can modify it later in a small follow-up PR.

bors bot pushed a commit to bevyengine/bevy that referenced this pull request Sep 17, 2021
…vy Book (#2365)

## Objective

The upcoming Bevy Book makes many references to the API documentation of bevy.

Most references belong to the first two chapters of the Bevy Book:

- bevyengine/bevy-website#176
- bevyengine/bevy-website#182

This PR attempts to improve the documentation of `bevy_ecs` and `bevy_app` in order to help readers of the Book who want to delve deeper into technical details.

## Solution

- Add crate and level module documentation
- Document the most important items (basically those included in the preludes), with the following style, where applicable:
    - **Summary.** Short description of the item.
    - **Second paragraph.** Detailed description of the item, without going too much in the implementation.
    - **Code example(s).**
    - **Safety or panic notes.**

## Collaboration

Any kind of collaboration is welcome, especially corrections, wording, new ideas and guidelines on where the focus should be put in.

---

### Related issues

- Fixes #2246
content/learn/book/welcome/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/apps/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/apps/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/apps/_index.md Show resolved Hide resolved
content/learn/book/welcome/apps/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/apps/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/plugins/_index.md Outdated Show resolved Hide resolved
content/learn/book/welcome/plugins/_index.md Outdated Show resolved Hide resolved
@alice-i-cecile
Copy link
Member Author

Alright @cart et al., this is good for a final review round now. The examples aren't automatically compiled yet, but I'd prefer to leave that to a seperate PR. I've tried to poke at it a couple times now and couldn't quite get it working and I think it's wiser to focus on writing and editing work.


For the fastest iterative compile times, we recommend the following configuration as well. You need to follow all three steps for any effect:

1. **LLD linker**: The Rust compiler spends a lot of time in the "link" step. LLD is _much faster_ at linking than the default Rust linker. To install LLD, find your OS below and run the given command:
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe also suggest using mold for people using linux

```

* **MacOS**: Modern LLD does not yet support MacOS, but we can use zld instead: `brew install michaeleisel/zld/zld`
2. **Nightly Rust Compiler**: This gives access to the latest performance improvements and "unstable" optimizations
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this step should clearly be marked as optional or at least be more obvious that this is purely for compilation speed and that bevy doesn't require nightly to work. Bevy works without any issues on stable rust so I wouldn't want anyone to think they need nightly.

So, what sort of data does our {{rust_type(type="struct" crate="bevy" mod = "app" name="App" no_mod = "true")}} really store?
Looking at the docs linked, we find three fields: `world`, `schedule` and `runner`.
The `world` field stores all of our game's data, the `schedule` holds the systems that operate on this data (and the order in which they do so) and the `runner` interprets the schedule to control the broad execution strategy.
You can read more about these by exploring the reference documentation linked just above.
Copy link
Contributor

@IceSentry IceSentry Oct 15, 2021

Choose a reason for hiding this comment

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

It is not immediately obvious to me which documentation link this is referencing. I think adding an actual link here would be better.

@rparrett rparrett mentioned this pull request Dec 31, 2021
@cart
Copy link
Member

cart commented Feb 10, 2022

Merging this as I think its in a reasonable spot. But before publishing this, I'd still like to do a pass over the introduction, because as I mentioned 7.5 months ago (!!!!!! sorry sorry sorry !!!!!), it is kind of like the front page of the website and I'd like to have firm control over how Bevy is introduced.

@cart cart merged commit 579edc7 into bevyengine:new-book Feb 10, 2022
@alice-i-cecile
Copy link
Member Author

But before publishing this, I'd still like to do a pass over the introduction, because as I mentioned 7.5 months ago (!!!!!! sorry sorry sorry !!!!!), it is kind of like the front page of the website and I'd like to have firm control over how Bevy is introduced.

Agreed! We'll do a proper pass before publication.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants