-
-
Notifications
You must be signed in to change notification settings - Fork 366
Swift 6 #318
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
base: master
Are you sure you want to change the base?
Swift 6 #318
Conversation
Thank you for the PR!! This is great work. I will review Thanks especially for the test runner cleanup. That was a pain point in maintaining this
This is done for performance reasons to avoid copying data when it can be avoided. If this adds friction, please add both [UInt8] and ArraySlice, and avoid using [UInt8] when ArraySlice will suffice for internally-used methods. In fact I would like to change more [UInt8] usage over to ArraySlice where possible, though it is more challenging to work with so it should probably only be for lib-internal use |
Reverted some changes to keep using ArraySlice 👌 |
@makoni just one more question for you above re: MainActor... thanks again |
@makoni tests are failing due to
(should be an easy fix, I can help later on...) |
|
@makoni thank you for the hard work on these updates I see there are 2 failures on the Ubuntu build:
I'm not sure at the moment what's causing this It would also be great to retain the test suite on Swift 5.9 for backwards compatibility - many (including myself) still haven't upgraded to Swift 6. But maybe that doesn't matter since the individual module can be built on Swift 6 and used in a Swift 5 codebase I guess (haven't investigated how this works yet) |
Summary of Changes
Issue: #271
1. Swift Concurrency & Thread Safety
@unchecked Sendable
conformance to many core classes and structs (e.g., Element, Document, Node, Tag, Entities, etc.), allowing safe usage in concurrent contexts and aligning with Swift's evolving concurrency model.Tag
andEntities
to use thread-safe access (e.g., locks and registries), preventing race conditions and improving reliability in multi-threaded usage.2. Package & Platform Updates
Package.swift
from 5.9 to 6.0, enabling the latest Swift language features and tooling improvements.3. Code Quality & Consistency
let
instead ofvar
for immutability and performance.[UInt8]
instead ofArraySlice<UInt8>
, simplifying usage and consistency.@MainActor
annotations to various methods and tests, clarifying main-thread affinity where necessary.4. Test Suite Improvements
LinuxMain.swift
file and the manualallTests
arrays from all test classes, as these are no longer needed with modern SwiftPM/XCTest.