Skip to content

Conversation

@krodak
Copy link
Member

@krodak krodak commented Nov 24, 2025

Introduction

Final part of improvements to address #451 and discussions from: #448 (comment)

Overview

  • adding exposeToGlobal option to BridgeJS configuration
  • exposeToGlobal is carried over via .json skeleton files
  • I needed to add tsFullPath to include full paths in namespaced declarations in d.ts when no declare global is available:
"swiftCallName" : "Internal.SupportedMethod",
"tsFullPath" : "Networking.APIV2.Internal.SupportedMethod"
  • defaults exposeToGlobal to false, so declare global is omitted
  • separate set of snapshots to test exposeToGlobal: true marked with suffix: .Global

Testing

On that part I'm not convinced with current setup for end-to-end tests but hadn't had better ideas.
I've setup separate prelude that includes global this access tests and removed those from main prelude. I've added unittest-with-global to makefile, so we can test it via CLI, but I haven't added this to CI / CD pipelines.
Let's discuss whether this approach is fine and we should extend CI or should I revert those changes, and we should just keep single prelude.
Main issue that I have with current changes is that I was unable to find any way to filter tests, so needed to duplicate couple of test cases

@krodak krodak self-assigned this Nov 24, 2025
@krodak krodak changed the title Feat/configurable global namespace BridgeJS: exposeToGlobal configuraiton option to control declare global declaration Nov 24, 2025
@krodak krodak force-pushed the feat/configurable-global-namespace branch 5 times, most recently from a9b1581 to 72ff3c7 Compare November 24, 2025 10:57
@krodak krodak changed the title BridgeJS: exposeToGlobal configuraiton option to control declare global declaration BridgeJS: exposeToGlobal configuration option to control declare global declaration Nov 25, 2025
@krodak krodak force-pushed the feat/configurable-global-namespace branch 2 times, most recently from 85fb06f to 98bb072 Compare November 27, 2025 14:58
BridgeJS: Extend snapshot test setup for exports <-> global this by including mixed module test case
@krodak krodak force-pushed the feat/configurable-global-namespace branch from 98bb072 to 4a682aa Compare November 27, 2025 15:58
Copy link
Member

@kateinoigakukun kateinoigakukun left a comment

Choose a reason for hiding this comment

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

Thanks!

@krodak krodak merged commit 1fda970 into swiftwasm:main Nov 28, 2025
14 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants