Skip to content

[pull] main from swiftwasm:main - #7

Open
pull[bot] wants to merge 1268 commits into
majacQ:mainfrom
swiftwasm:main
Open

[pull] main from swiftwasm:main#7
pull[bot] wants to merge 1268 commits into
majacQ:mainfrom
swiftwasm:main

Conversation

@pull

@pull pull Bot commented Jul 19, 2021

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

@pull pull Bot added ⤵️ pull merge-conflict Resolve conflicts manually labels Jul 19, 2021
@atomist atomist Bot added auto-branch-delete:on-close Delete branch when pull request gets closed auto-merge-method:merge Auto-merge with merge commit auto-merge:on-bpr-success Auto-merge on passed branch protection rule labels Jul 19, 2021
@pull pull Bot removed auto-branch-delete:on-close Delete branch when pull request gets closed auto-merge-method:merge Auto-merge with merge commit auto-merge:on-bpr-success Auto-merge on passed branch protection rule labels Jul 19, 2021
kateinoigakukun and others added 22 commits February 10, 2026 11:12
- Rename `optionalRepresentation` to `asOptional`.
- Remove `undefinedValue` static property and use `.undefined` case directly.
BridgeJS: Update `JSUndefinedOr` APIs
to be consistent with other environment variables used by BridgeJS.
BridgeJS: Include source-context in diagnostic messages
* BridgeJS: Allow executing TS2SwiftVitestTests on Xcode

* BridgeJS: Remove parsing API usage from JSSetterMacro

* BridgeJS: Remove BasicFormat usage in ExportSwift
NCF: BridgeJS: Generalize Optional stack ABI for Array, Dictionary, and Struct types
…fication

NFC: BridgeJS: Delegate nested container codegen to generic runtime conformances
[NFC] BridgeJS: Minimize enum with assoc values code generation
…tion

NFC: BridgeJS: Simplify liftExpression by using no-arg bridgeJSLiftParameter() for enums and protocols
NFC: BridgeJS: Simplify ExportSwift codegen by removing redundant branches and extracting helpers
krodak and others added 3 commits June 24, 2026 14:09
Follow-up to the review on #750:

- ImportTS: give the unreachable `.alias` cases in loweringParameterInfo /
  liftingReturnInfo a message stating the `.unaliased` invariant, so a future
  change that breaks it fails loudly instead of trapping silently.
- JSGlueGen: in `optionalConvention` and `wasmParams`, delegate `.alias` to its
  underlying type rather than `preconditionFailure()`. These switch on `self`
  (not `.unaliased`), so this removes a latent crash for alias-wrapped values
  and matches how abiReturnType / mangleTypeName already handle `.alias`.
- SwiftToSkeleton: diagnose `@JS(as:)` combined with `namespace:` instead of
  silently dropping the namespace; an alias adopts its representation's
  placement. Adds a diagnostics test.
- BridgeJSSkeleton: note why alias mangling uses the (unique) swiftCallName only.
- Docs: add an "Exporting a Type With a Custom JS Representation" article and
  link it from the exporting topics.
BridgeJS: Export types using a separate JS representation
MaxDesiatov and others added 26 commits July 1, 2026 12:59
BridgeJS: Fix issues exporting nested types
…oding

BridgeJS: Unify optional stack encoding to presence-flag form
Bumps [actions/setup-node](https://github.com/actions/setup-node) from 6 to 7.
- [Release notes](https://github.com/actions/setup-node/releases)
- [Commits](actions/setup-node@v6...v7)

---
updated-dependencies:
- dependency-name: actions/setup-node
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…rder

BridgeJS: Fix argument order for stack-lowered imported parameters
…origins (#795)

* BridgeJS: support importing from external ECMAScript modules

Extend `from: .module(...)` to accept bare specifiers like `node:path` or an npm package,
add `jsName: .default` for default exports, and emit named imports so a wrong export name
now fails at module-link time instead of at call time.

* BridgeJS: fix named-import regressions found in review

Do not require a module export for a wrapper-only `@JSClass`, since a named import is a
link-time requirement and nothing looks that name up; accept `jsName: nil` and the explicit
`.name(...)` spelling; and validate the tagged `from` form like the plain-string form.

* BridgeJS: split snippet and external module import origins

Use `from: .snippet("/my-file.js")` for a JavaScript file shipped with the Swift target and
`from: .module("node:path")` for an external module, so each keeps its own validation and
each mistaken form points at the other. The skeleton encoding is unchanged.

* BridgeJS: tag both snippet and module origins in the skeleton

Encode `.snippet` as `{"kind":"snippet","path":...}` alongside the existing tagged module
form, so the JSON mirrors the Swift cases and a snippet path can no longer encode into a
shape that fails to decode.
bridgeJSLowerParameter for structs used toJSObject(), so Swift→JS
callbacks discarded the stack and JS lift() read garbage. Match arrays:
stack-push on lower, and use the same ABI for ImportTS non-optional structs.
BridgeJS: Unify @js struct parameter lowering onto the stack ABI
BridgeJS: Support generic functions on imported JS APIs
An imported optional whose payload is stack-only ([T]?, [String: V]?,
@js struct?) used a hybrid convention: the isSome flag crossed as a wasm
i32 parameter while the payload was conditionally pushed onto the shared
stacks. Optional returns and optional array elements of the same types
already travel entirely on the stacks: payload first, then a 0/1 flag on
the i32 stack.

This lowers those parameters the same way. The Swift thunk pushes the
payload (if some) followed by the flag, the wasm signature carries no
argument for the parameter, and the JS handler pops the flag before
conditionally lifting the payload, through the same fragment already
used for optional returns and elements.

The hybrid shape was the last parameter category that both passed a wasm
argument and pushed stack data, which is what enabled the argument
transposition fixed in #794. Every stack-touching parameter is now
flagless and reverse-ordered, matching returns and elements. All other
optional parameter ABIs (scalars, strings, JSObject, closures, enums,
heap objects) are unchanged.
BridgeJS: Lower imported optional stack parameters fully on the stack
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

⤵️ pull merge-conflict Resolve conflicts manually

Projects

None yet

Development

Successfully merging this pull request may close these issues.