Skip to content

Update JS static globals to use new wasm_bindgen(thread_local) #538

@shanemadden

Description

@shanemadden

We're currently having to suppress deprecation warnings https://github.com/rustyscreeps/screeps-game-api/blob/main/src/lib.rs#L99 due to our use of JsStatic instead of the new thread_local method offered by wasm_bindgen for memory's ROOT as well as ROOM_POSITION_PROTOTYPE/COST_MATRIX_PROTOTYPE. I spent a few minutes trying to get these variables usable with the new approach and it wasn't immediately obvious due to additional wrapping by LocalKey - need to work this out then remove the suppression of the deprecation warnings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-cleanupCategory: PRs that clean code up or issues documenting cleanup.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions