GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — BridgeJS: Include namespace prefix in ABI names for namespace-nested classes and structs by krodak · Pull Request #683 · swiftwasm/JavaScriptKit

Conversation

@krodak

@krodak krodak commented Feb 27, 2026

Copy link
Copy Markdown
Member

Overview

ABI names for namespace-nested classes omit the namespace, causing symbol collisions when two namespace enums contain a class with the same bare name. For example, @JS enum Utils { @JS class Converter {} } and @JS enum Formatting { @JS class Converter {} } both produce bjs_Converter_init.

This PR adds an abiName computed property to ExportedClass and ExportedStruct that joins namespace + name with _, then updates all ABI name generation sites to use it.

1. Skeleton model - Added abiName to ExportedClass and ExportedStruct in BridgeJSSkeleton.swift. Returns namespace_name when namespaced, bare name otherwise.

2. SwiftToSkeleton - Constructor, method, static method, and static property ABI names now use abiName from the looked-up class/struct instead of the bare name from the parser state.

3. ExportSwift - Deinit, wrap, and PropertyRenderingContext.className now use abiName.

4. BridgeJSLink - Deinit, wrap, property className, and struct helper Wasm intrinsic names (swift_js_struct_lower_* / swift_js_struct_lift_*) now use abiName.

Before:

bjs_Converter_init, bjs_Converter_deinit, bjs_HTTPServer_call

After:

bjs_Utils_Converter_init, bjs_Utils_Converter_deinit, bjs_Networking_API_HTTPServer_call

5. Collision test - Added @JS enum Formatting { @JS class Converter } alongside @JS enum Utils { @JS class Converter } in the EnumNamespace test input to validate distinct ABI names.

Top-level (non-namespaced) classes and structs are unaffected - abiName falls back to name.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@krodak
krodak force-pushed the kr/namespace-abi-names branch from 085ad29 to c03f108 Compare February 27, 2026 16:30
@krodak
krodak requested a review from kateinoigakukun February 27, 2026 16:36
@krodak krodak self-assigned this Feb 27, 2026
@krodak
BridgeJS: Include namespace prefix in ABI names for namespace-nested …
494ed16
…classes and structs
@krodak
krodak force-pushed the kr/namespace-abi-names branch from c03f108 to 494ed16 Compare February 27, 2026 16:42
kateinoigakukun
kateinoigakukun approved these changes Feb 27, 2026
View reviewed changes
@krodak
krodak merged commit 1750eff into swiftwasm:main Feb 27, 2026
12 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@krodak
krodak deleted the kr/namespace-abi-names branch March 27, 2026 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@kateinoigakukun kateinoigakukun kateinoigakukun approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@krodak krodak

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@krodak @kateinoigakukun
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.