Fixes for compatibility with Embedded Swift#61
Merged
kateinoigakukun merged 5 commits intomainfrom Jun 6, 2025
Merged
Conversation
The change improves support for Embedded Swift mode for broader set of APIs in the WebAPIKit library. Specifically: 1. `_Concurrency` module has to be imported explicitly for Embedded Swift 2. Fixed missing parentheses in the `canImport` statement, which led to incorrect conditional compilation checks; 3. Added support for missing WebIDL modules; 4. Bumped package manifest to Swift 6.1, since older versions of Swift aren't supported; 6. Bumped deployment target OS version requirement to align it with the JavaScriptKit dependency; 7. Bumped JavaScriptKit dependency to the latest version that contains necessary fixes for Embedded Swift; 8. Enabled compatibility with Swift 5 language mode 9. Using typed throws and correct integer width in relevant APIs as required for Embedded Swift. 10. Fixes closure wrappers for code that utilizes callbacks.
The change improves compatibility with Embedded Swift. Specifically: 1. Cleans up accessors for properties to avoid use of property wrappers, which allows binary size to be slightly reduced. 2. Fixes dictionary-like types that previously had incorrect initializers not inheriting properties from superclasses.
The CSSOM module has different context after previously applied changes for Embedded Swift support. `override` modifiers are not applicable with embedded Swift and need to be replaced with `final`. Similarly `Self` is replaced with explicit class names to avoid use of implicit metatypes currently incompatible with Embedded Swift. Certain initializers also had to become `public` to be usable in library clients.
1. Use of a property wrapper replaced with direct accessors use; 2. Use of `override` is avoided in computed properties and functions; 3. Initializers made `public` for adoption in library clients
1. Direct accessors are used instead of property wrappers in both DOM and SVG modules. 2. Avoiding use of `override` function declaration modifier in favor of `final` with an explicit generic types to avoid using implicit metatypes incompatible with Embedded Swift. 3. Formatting changes to make code compatible with the standard swift-format tool, that fixes automation incompatible with use of SwiftFormat instead of swift-format.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The change improves support for Embedded Swift mode for broader set of APIs in the WebAPIKit library. Specifically:
_Concurrencymodule has to be imported explicitly for Embedded Swift;canImportstatement, which led to incorrect conditional compilation checks;overridefunction declaration modifier in favor offinalwith an explicit generic types to avoid using implicit metatypes incompatible with Embedded Swift;