DioxusLabs / blitz

A radically modular HTML/CSS rendering engine
Apache License 2.0
2.14k stars 45 forks source link

Bug Report for `blitz-core` Project: Version Mismatch in `keyboard-types` #52

Closed QEU-B-458 closed 1 year ago

QEU-B-458 commented 1 year ago

Bug Report: Version Mismatch in keyboard-types for blitz-core Project

Issue Description

While compiling the blitz-core project, I encountered a compilation error. The error seems to be due to a type mismatch between different versions (0.6.2 and 0.7.0) of the keyboard_types crate.

Error Output

error[E0308]: arguments to this function are incorrect
   --> blitz-core\src\events.rs:171:65
    |
171 |                         let data = Arc::new(EventData::Keyboard(KeyboardData::new(
    |                                                                 ^^^^^^^^^^^^^^^^^
...
error[E0308]: mismatched types
   --> blitz-core\src\events.rs:514:24
    |
514 |             .unwrap_or(Code::Unidentified),
    |                        ^^^^^^^^^^^^^^^^^^
...
error[E0308]: `match` arms have incompatible types
   --> blitz-core\src\events.rs:513:14
    |
513 |           _ => input_data::keyboard_types::Code::from_str(&code.to_string())
    |                -----------------------------------------------------------
514 |                 .unwrap_or(Code::Unidentified),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...

cargo tree Output

# Output for 0.6.2 version
keyboard-types v0.6.2
└── blitz-core v0.1.0

# Output for 0.7.0 version
keyboard-types v0.7.0
├── dioxus-html v0.4.2
│   └── blitz-core v0.1.0
└── dioxus-native-core v0.4.2
    └── blitz-core v0.1.0

**Solution

The conflict was resolved by updating blitz-core to use keyboard-types version 0.7.0 instead of 0.6.2.

**Suggested Actions

  1. Update the keyboard-types dependency in the Cargo.toml of blitz-core to 0.7.0 to align with other dependencies.
  2. If the need arises for different versions to coexist, consider using feature flags or conditional compilation to separate version-specific code.

Environment:

Questionnaire