Skip to content

Makes reflect an explicit flag#796

Merged
gbin merged 31 commits into
masterfrom
gbin/schema_flag
Feb 10, 2026
Merged

Makes reflect an explicit flag#796
gbin merged 31 commits into
masterfrom
gbin/schema_flag

Conversation

@gbin

@gbin gbin commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

Related issues

  • Closes #

Changes

Testing

  • just std-ci
  • just lint
  • cargo +stable nextest run --workspace --all-targets
  • Other (please specify):

Checklist

  • I have updated docs or examples where needed
  • I have added or updated tests where needed
  • I have considered platform impact (Linux/macOS/Windows/embedded)
  • I have considered config/logging changes (if applicable)
  • This change is not a breaking change (or I documented it below)

Breaking changes (if any)

Additional context

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR makes Copper’s runtime reflection support explicitly opt-in via a reflect Cargo feature, reducing the default dependency footprint (notably bevy_reflect) while keeping code that derives/uses Reflect compiling via a no-op fallback derive when reflection is disabled.

Changes:

  • Introduce a reflect feature across core crates and propagate it through examples/components that rely on task introspection.
  • Make bevy_reflect optional and add cu29-reflect-derive as a fallback no-op #[derive(Reflect)] when reflection is disabled.
  • Add compile-time gating/behavior changes around reflection helpers and debug introspection.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
examples/cu_reflect_demo/Cargo.toml Enable reflect feature for demo dependencies that require reflection.
examples/cu_debug_session/Cargo.toml Enable reflect to support debug/introspection example.
examples/cu_bridge_test/Cargo.toml Add a reflect feature and gate a binary behind required-features.
core/cu29_runtime/tests/sim_bridge.rs Remove direct bevy_reflect import in tests to align with optional reflection.
core/cu29_runtime/src/reflect.rs Add reflect feature gating and provide non-reflect fallback traits/types and schema dump behavior.
core/cu29_runtime/src/payload.rs Gate bevy_reflect import for optional reflection.
core/cu29_runtime/src/debug.rs Return a clear error when task introspection is used without reflect.
core/cu29_runtime/Cargo.toml Make bevy_reflect optional and add reflect feature; add cu29-reflect-derive dep.
core/cu29_reflect_derive/src/lib.rs New no-op Reflect derive proc-macro for non-reflect builds.
core/cu29_reflect_derive/Cargo.toml New proc-macro crate manifest for cu29-reflect-derive.
core/cu29_clock/src/lib.rs Make Reflect derive conditional via cfg_attr(feature = "reflect", ...).
core/cu29_clock/Cargo.toml Make bevy_reflect optional and add a reflect feature.
core/cu29/src/lib.rs Export ReflectTypePath in the prelude.
core/cu29/Cargo.toml Add top-level reflect feature that enables runtime + clock reflection.
components/tasks/cu_pid/src/lib.rs Switch bounds to ReflectTypePath to avoid requiring reflection when disabled.
components/tasks/cu_pid/Cargo.toml Add reflect feature forwarding to cu29/reflect and drop direct bevy_reflect dep.
Cargo.toml Add the new core/cu29_reflect_derive workspace member and workspace dependency.
Comments suppressed due to low confidence (1)

core/cu29_runtime/src/reflect.rs:99

  • dump_type_registry_schema calls format("{info:#?}") without invoking the format! macro (missing !). This won’t compile when the reflect feature is enabled; use the format! macro (or otherwise build the string) instead.
        .iter()
        .map(|registration| {
            let info = registration.type_info();
            (info.type_path(), format!("{info:#?}"))
        })

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread core/cu29_runtime/src/payload.rs
Comment thread core/cu29_runtime/src/payload.rs
@gbin

gbin commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator Author

yeah this is for a circular dep reason

Base automatically changed from gbin/schema to master February 9, 2026 23:29
# Conflicts:
#	components/tasks/cu_pid/src/lib.rs
#	core/cu29/src/lib.rs
#	core/cu29_clock/Cargo.toml
#	core/cu29_clock/src/lib.rs
#	core/cu29_runtime/Cargo.toml
#	core/cu29_runtime/src/debug.rs
#	core/cu29_runtime/src/reflect.rs
#	examples/cu_reflect_demo/Cargo.toml
@gbin gbin merged commit d30882c into master Feb 10, 2026
23 checks passed
@gbin gbin deleted the gbin/schema_flag branch February 10, 2026 00:02
@makeecat

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants