Skip to content

Fixes for compatibility with Embedded Swift #61

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jun 6, 2025
Merged

Conversation

MaxDesiatov
Copy link
Contributor

@MaxDesiatov MaxDesiatov commented Jun 5, 2025

The change improves support for Embedded Swift mode for broader set of APIs in the WebAPIKit library. Specifically:

  • _Concurrency module has to be imported explicitly for Embedded Swift;
  • Fixed missing parentheses in the canImport statement, which led to incorrect conditional compilation checks;
  • Added support for missing WebIDL modules;
  • Bumped package manifest to Swift 6.1, since older versions of Swift aren't supported;
  • Bumped deployment target OS version requirement to align it with the JavaScriptKit dependency;
  • Bumped JavaScriptKit dependency to the latest version that contains necessary fixes for Embedded Swift;
  • Enabled compatibility with Swift 5 language mode
  • Using typed throws and correct integer width in relevant APIs as required for Embedded Swift.
  • Fixes closure wrappers for code that utilizes callbacks.
  • Cleaned up accessors for properties to avoid use of property wrappers, which allows binary size to be slightly reduced;
  • Fixed dictionary-like types that previously had incorrect initializers not inheriting properties from superclasses.
  • 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;
  • Formatting changes to make code compatible with the standard swift-format tool, that fixes automation incompatible with use of SwiftFormat instead of swift-format.

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.
@kateinoigakukun kateinoigakukun merged commit cd7d4ad into main Jun 6, 2025
0 of 2 checks passed
@kateinoigakukun kateinoigakukun deleted the maxd/embedded1 branch June 6, 2025 00:54
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