Repository: bevyengine/bevy
File: crates/bevy_ecs/src/entity_disabling.rs (Rust)

Code before:
/// Like all disabling components, this only disables the entity itself,
/// not its children or other entities that reference it.
/// To disable an entire tree of entities, use [`EntityCommands::insert_recursive`](crate::prelude::EntityCommands::insert_recursive).
///
/// Every [`World`] has a default query filter that excludes entities with this component,
/// registered in the [`DefaultQueryFilters`] resource.
/// See [the module docs] for more info.
///
/// [the module docs]: crate::entity_disabling
#[derive(Component, Clone, Debug, Default)]
#[cfg_attr(
    feature = "bevy_reflect",
    derive(Reflect),
    reflect(Component),
    reflect(Debug, Clone, Default)
)]
// This component is registered as a disabling component during World::bootstrap
pub struct Disabled;

/// A marker component for internal entities.
///
/// This component is used to mark entities as being internal to the engine.
/// Internal entities are hidden from queries using [`DefaultQueryFilters`].
/// It is still possible to query them through a [`With<Internal>`] filter, [`EntityMutExcept`], or [`EntityRefExcept`].
/// Methods like [`World::iter_entities`] and [`World::iter_entities_mut`] can also still access internal entities.
/// However, we strongly advise against altering or removing entities tagged with this component in any way.
///
/// [`With<Internal>`]: crate::prelude::With
/// [`EntityMutExcept`]: crate::world::EntityMutExcept
/// [`EntityRefExcept`]: crate::world::EntityRefExcept
/// [`World::iter_entities`]: crate::prelude::World::iter_entities
/// [`World::iter_entities_mut`]: crate::prelude::World::iter_entities_mut
#[derive(Component, Clone, Debug, Default)]
#[cfg_attr(
    feature = "bevy_reflect",
    derive(Reflect),
    reflect(Component),
    reflect(Debug, Clone, Default)
)]
// This component is registered as a disabling component during World::bootstrap
pub struct Internal;

/// Default query filters work by excluding entities with certain components from most queries.
///
/// If a query does not explicitly mention a given disabling component, it will not include entities with that component.
/// To be more precise, this checks if the query's [`FilteredAccess`] contains the component,
/// and if it does not, adds a [`Without`](crate::prelude::Without) filter for that component to the query.
///
/// This resource is initialized in the [`World`] whenever a new world is created,
/// with the [`Disabled`] component as a disabling component.
///

Review comment (suggestion):
```suggestion
/// However, we strongly advise against altering, removing or relying on entities tagged with this component in any way.
/// These are "internal implementation details", and may not be robust to these changes or stable across minor Bevy versions.
```

Code after:
/// Like all disabling components, this only disables the entity itself,
/// not its children or other entities that reference it.
/// To disable an entire tree of entities, use [`EntityCommands::insert_recursive`](crate::prelude::EntityCommands::insert_recursive).
///
/// Every [`World`] has a default query filter that excludes entities with this component,
/// registered in the [`DefaultQueryFilters`] resource.
/// See [the module docs] for more info.
///
/// [the module docs]: crate::entity_disabling
#[derive(Component, Clone, Debug, Default)]
#[cfg_attr(
    feature = "bevy_reflect",
    derive(Reflect),
    reflect(Component),
    reflect(Debug, Clone, Default)
)]
// This component is registered as a disabling component during World::bootstrap
pub struct Disabled;

/// A marker component for internal entities.
///
/// This component is used to mark entities as being internal to the engine.
/// These entities should be hidden from the developer's view by default,
/// as they are both noisy and expose confusing implementation details.
/// Internal entities are hidden from queries using [`DefaultQueryFilters`].
/// For more information, see [the module docs].
/// We strongly advise against altering, removing or relying on entities tagged with this component in any way.
/// These are "internal implementation details", and may not be robust to these changes or stable across minor Bevy versions.
///
/// [the module docs]: crate::entity_disabling
#[derive(Component, Clone, Debug, Default)]
#[cfg_attr(
    feature = "bevy_reflect",
    derive(Reflect),
    reflect(Component),
    reflect(Debug, Clone, Default)
)]
// This component is registered as a disabling component during World::bootstrap
pub struct Internal;

/// Default query filters work by excluding entities with certain components from most queries.
///
/// If a query does not explicitly mention a given disabling component, it will not include entities with that component.
/// To be more precise, this checks if the query's [`FilteredAccess`] contains the component,
/// and if it does not, adds a [`Without`](crate::prelude::Without) filter for that component to the query.
///
/// This resource is initialized in the [`World`] whenever a new world is created,
/// with the [`Disabled`] component as a disabling component.
///
/// Note that you can remove default query filters by overwriting the [`DefaultQueryFilters`] resource.
/// This can be useful as a last resort escape hatch, but is liable to break compatibility with other libraries.