Skip to content

[BridgeJS] Support @JS type references across modules within the same package #720

@wfltaylor

Description

@wfltaylor

Larger packages are often split into multiple modules. For example, a package could contain a foundational Vector3D type in a Core module which is used by the public interface of the App module.

// “Core” Module

@JS public struct Vector3D {

    let x: Double
    let y: Double
    let z: Double

}

// “App” Module

import Core

@JS func currentVelocity() -> Vector3D {
    // ...
}

Currently, the “App” module would have to wrap any types defined in other modules, or everything would have to be defined in the one module. Both of these workarounds are undesirable.

This could possibly work by parsing the BridgeJS.json skeleton of dependent targets in the code generation plugin. Further thought would probably be needed regarding ahead of time generation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions