Skip to content

Commit

Permalink
Merge branch 'main' into 160_flatten_book_layout_structure
Browse files Browse the repository at this point in the history
  • Loading branch information
TrialDragon committed Jan 22, 2024
2 parents 5daf6c3 + e1cadb9 commit ef6e6df
Show file tree
Hide file tree
Showing 8 changed files with 394 additions and 276 deletions.
2 changes: 1 addition & 1 deletion content/learn/book/getting-started/ecs.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ fn main() {
}
```

Note that we have used `.chain()` on the two systems. This is because we want them two to run in exactly the order they're listed in the code: with `update_people` occurring before `greet_people`.
Note that we have used `.chain()` on the two systems. This is because we want both of them to run in exactly the order they're listed in the code: with `update_people` occurring before `greet_people`.
If they weren’t, the name might change after we greet the people.

But we don’t add the `hello_world` system to the chain, because it doesn’t matter when it runs. This way, Bevy can run `hello_world` in parallel while the other systems are running.
19 changes: 4 additions & 15 deletions content/learn/book/getting-started/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,11 @@ opt-level = 3

You might think to simply develop in release mode instead, but we recommend against this as it can worsen the development experience by slowing down recompiles and disabling helpful debug symbols and assertions.

### Enable Fast Compiles (Optional)
### Advanced: Optimize your compilation times

Bevy can be built just fine using default configuration on stable Rust. However for maximally fast iterative compiles, we recommend the following configuration:
Bevy works great using Rust's default configuration. However, if you know your way around a compiler and find that Bevy's iterative compilation times are still too slow for you, try fine-tuning the following options:

* **Enable Bevy's Dynamic Linking Feature**: This is the most impactful compilation time decrease! If `bevy` is a dependency, you can compile the binary with the "dynamic_linking" feature flag (enables dynamic linking). **Important!** On Windows you _must_ also enable the [perfomance optimizations](#compile-with-performance-optimizations) or you will get a [`too many exported symbols`](https://github.com/bevyengine/bevy/issues/1110#issuecomment-1312926923) error.
* **Enable Bevy's Dynamic Linking Feature**: This is the most impactful compilation time decrease! If `bevy` is a dependency, you can compile the binary with the "dynamic_linking" feature flag (enables dynamic linking). **Important!** On Windows you _must_ also enable the [performance optimizations](#compile-with-performance-optimizations) or you will get a [`too many exported symbols`](https://github.com/bevyengine/bevy/issues/1110#issuecomment-1312926923) error.

```sh
cargo run --features bevy/dynamic_linking
Expand Down Expand Up @@ -188,20 +188,9 @@ Bevy can be built just fine using default configuration on stable Rust. However

NOTE: Disabling `bevy/dynamic` may improve the performance of this linker.

* **Nightly Rust Compiler**: This gives access to the latest performance improvements and "unstable" optimizations

Create a ```rust-toolchain.toml``` file in the root of your project, next to ```Cargo.toml```.

```toml
[toolchain]
channel = "nightly"
```

For more information, see [The rustup book: Overrides](https://rust-lang.github.io/rustup/overrides.html#the-toolchain-file).

* **Generic Sharing**: Allows crates to share monomorphized generic code instead of duplicating it. In some cases this allows us to "precompile" generic code so it doesn't affect iterative compiles. This is only available on nightly Rust.
To enable fast compiles, install the nightly rust compiler and LLD. Then copy the contents of [this file](https://github.com/bevyengine/bevy/blob/main/.cargo/config_fast_builds) to `YOUR_WORKSPACE/.cargo/config.toml`. For the project in this guide, that would be `my_bevy_game/.cargo/config.toml`.
To enable generic sharing, first install the nightly rust compiler and LLD. Then copy the contents of [this file](https://github.com/bevyengine/bevy/blob/main/.cargo/config_fast_builds) to `YOUR_WORKSPACE/.cargo/config.toml`. For the project in this guide, that would be `my_bevy_game/.cargo/config.toml`.
If something went wrong, check out our [troubleshooting section](/learn/book/troubleshooting/) or [ask for help on our Discord](https://discord.com/invite/gMUk5Ph).
Expand Down
16 changes: 16 additions & 0 deletions content/learn/migration-guides/0.11-to-0.12.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,22 @@ AssetEvent::Modified { id } => {

Also, as you may have noticed, the set of events has changed. The most important of these is `LoadedWithDependencies` which tells you that the asset and all its dependencies have finished loading into memory.

#### `UntypedHandle`

`HandleUntyped` has been renamed to `UntypedHandle`.
`HandleId` has been replaced with `UntypedAssetId` and its typed equivalent `AssetId<T>`.

The new way to construct an untyped handle looks like this:

```rust
// 0.11
const MESH_HANDLE: HandleUntyped =
HandleUntyped::weak_from_u64(Mesh::TYPE_UUID, 0x1f40128bac02a9b);
// 0.12
const MESH_HANDLE: UntypedHandle =
UntypedHandle::Weak(UntypedAssetId::Uuid { type_id: TypeId::of::<Mesh>(), uuid: Uuid::from_u128(0x1f40128bac02a9b) });
```

### [Copy on Write AssetPaths](https://github.com/bevyengine/bevy/pull/9729)

<div class="migration-guide-area-tags">
Expand Down
29 changes: 27 additions & 2 deletions sass/components/_syntax-theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,41 @@
}

div.incorrect {
position: relative;
background-color: #542326;
border-left: 10px solid red;
border-left: 10px solid darkred;
border-radius: 10px;
padding-right: 55px;

.z-code,
.z-code code {
background-color: #542326;
}
}

div.incorrect:hover {
border-color: red;

img {
/* SVG filter color for red */
filter: invert(10%) sepia(85%) saturate(7491%) hue-rotate(5deg) brightness(116%) contrast(114%);
}
}

div.incorrect-image {
position: absolute;
z-index: 99;
right: 20px;
top: 10px;

img {
width: 35px;
height: 35px;
/* SVG filter color for firebrick red */
filter: invert(11%) sepia(57%) saturate(5143%) hue-rotate(350deg) brightness(118%) contrast(87%);
}
}

.z-variable.z-parameter.z-function {
color: #c0c5ce;
}
Expand Down Expand Up @@ -277,4 +302,4 @@ div.incorrect {

.z-variable.z-parameter.z-option {
color: #c594c5ff;
}
}
71 changes: 71 additions & 0 deletions static/assets/error_icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/assets/fox.webp
Binary file not shown.
Loading

0 comments on commit ef6e6df

Please sign in to comment.