Skip to content

Releases: AlaskaAirlines/atom

v4.0.1

22 Jan 04:56
a480609
Compare
Choose a tag to compare
  • Disable library evolution support.
  • Update documentation (We are working on adding completion-based APIs and extending the Combine framework).

Full Changelog: v4.0.0...v4.0.1

v4.0.0

14 Jan 19:53
104917c
Compare
Choose a tag to compare

Introduction & Motivation

Swift 6 introduces several pivotal enhancements that significantly elevate its capabilities over previous versions, focusing on safety, performance, and broader platform support. One of the standout features is the introduction of compile-time data race safety in its concurrency model.

In Atom 4.0, we utilized the compile-time data race safety checks as a guiding principle to rewrite the underlying implementation of the networking code and access token refresh logic.

Swift 6 includes various compiler optimizations that enhance the efficiency of common operations, from collection handling to memory management.

In terms of language structure, Swift 6 brings improvements in error handling by allowing functions to specify exact error types, leading to more precise error management. This, combined with the introduction of noncopyable types, allowed us to update our implementation to throw an AtomError where errors could occur within the package implementation.
This means the client no longer needs to check the type of error returned by AtomNetworking, as it will always be an AtomError.

Moving to Swift 6 is really compelling if you're looking to future-proof your applications. We’ve rewritten AtomNetworking to make full use of these Swift 6 features.

Proposed Solution

As part of our move to Swift 6, we are implementing a series of significant upgrades to the AtomNetworking Swift package to ensure it aligns with the latest language features and standards. Here's a detailed look at the changes we're making:

  • Add support for Swift Tools version 6.0: We're updating our toolchain to take advantage of the new features and improvements in Swift 6, ensuring compatibility and leveraging the latest compiler optimizations.
swift-tools-version:6.0
  • Add support for Swift language version 6.0: This change not only includes adopting the new syntax and features of Swift 6 but also ensures our code benefits from the enhanced type safety and compile-time checks introduced in this version.
.swiftLanguageMode(.v6)
  • Enable BUILD_LIBRARY_FOR_DISTRIBUTION flag: This flag is set to prepare our library for distribution, ensuring it can be used across different platforms or within larger frameworks with optimal performance.

  • Enable library evolution: By turning this on, we're allowing our library to evolve over time without breaking ABI compatibility, which is crucial for maintaining stability when updating or extending the library's functionality.

.unsafeFlags(["-enable-library-evolution", "-O"]),
  • Clean up code: This involves removing outdated code, fixing minor issues, and generally tidying up the codebase to improve maintainability and performance.

  • Conform all necessary types to Sendable protocol: With the new concurrency model in Swift 6, we're making sure our types can be safely used in concurrent contexts, reducing the risk of data races and improving the robustness of our package in multi-threaded environments.

  • Move away from Retryable: We moved away from Retryable operations by transitioning both Atom and Service to actors, which ensured more robust and predictable system behavior.

  • Remove unnecessary availability checks: After updating our deployment target to iOS 15, we removed unnecessary availability checks to streamline our codebase and improve development efficiency.

  • Rename the Atom package to AtomNetworking: This renaming clarifies the package's purpose. It also addresses the compiler warning where the public class Atom was shadowing the module Atom, which could cause failures when importing Atom in some configurations.

  • Rewrite the AtomResponse object: By rewriting the AtomResponse object to support the new concurrency model, we ensure propert integration with Swift's async/await, enhancing both performance and developer experience.

  • Rewrite BaseURL and BaseURLScheme, and all internal types to throw typed errors: Updating BaseURL, BaseURLScheme, and our internal types to throw AtomError types enhances error management, making it easier to pinpoint and resolve issues without the need to check for error type first.

  • Update copyright headers: We're refreshing these headers to reflect the current year and to ensure all intellectual property aspects are up to date.

// Copyright (c) 2025 Alaska Airlines
  • Update deployment targets to iOS 15: By setting this target, we ensure our package leverages the latest capabilities of iOS while still being accessible to a broad user base on newer devices.

  • Update documentation script & documentation: New features and changes in Swift 6 necessitate updated documentation. We're enhancing our documentation tools and content to reflect these changes accurately.

  • Update the Example application: We've enhanced the Example application to demonstrate improved performance and stability.

  • Update MARK markers: We're organizing our code with updated MARK comments, which help in navigating the codebase more efficiently, especially in larger projects.

  • Update projects to recommended settings: We're aligning our project settings with Apple's latest recommendations for Swift 6, which includes settings for debugging, testing, and code signing.

  • Update UNIT tests: Testing is critical, especially with such significant updates. We're revising our unit tests to ensure they cover all new functionalities and conform to Swift 6's testing environment, ensuring our package remains robust and reliable.

    These changes collectively aim to make the AtomNetworking Swift package not just compatible with Swift 6 but also more efficient, safer, and easier to use, setting a good foundation for future development and broader platform support.

Detailed Design

See files changed.

Source compatibility

This implementation introduces a breaking change and will affect compatibility with existing source code.

  • Add support for Swift tools version 6.0.
  • Add support for Swift language version 6.0.
  • Enable the BUILD_LIBRARY_FOR_DISTRIBUTION flag.
  • Move away from Retryable.
  • Remove completion-based APIs.
  • Remove unnecessary availability checks.
  • Rename the Atom package to AtomNetworking to adress the compiler warning where the public class Atom was shadowing the module Atom.
  • Rewrite the AtomResponse object to support the new concurrency model.
  • Rewrite BaseURL and BaseURLScheme, and all internal types to throw typed errors.
  • Update the copyright headers.
  • Update the deployment targets to iOS 15.
  • Update the documentation script.
  • Update the Example application.
  • Update MARK markers.
  • Update the project to recommended settings.
  • Update the UNIT tests.

Time-out support

04 Jan 19:01
80715af
Compare
Choose a tag to compare

Allows clients to set timeout as part of service configuration to there desired interval.

Async-Await support

10 Nov 00:20
6f02530
Compare
Choose a tag to compare
  • Introduce async-await support.
  • Update protocol requirements from class to AnyObject.

README

21 Dec 18:30
b30d5cc
Compare
Choose a tag to compare
  • README.md updates.

Version 2.0

21 Dec 17:58
93ecd72
Compare
Choose a tag to compare
  • Add Combine support.
  • Introduce RequestableItem.
  • Introduce HeaderItem and QueryItem types. Conform and implement ExpressibleByDictionaryLiteral for cleaner Requestable conformance.
  • Move Atom's nested types to be their own (resolve nesting issues with SPM, etc).
  • Remove Carthage support (sorry). Please use SPM.
  • Update Example to use SwiftUI.
  • Update UNIT tests.
  • Update documentation.

SPM

12 Aug 22:08
2d2ed33
Compare
Choose a tag to compare
SPM
  • Add SPM support.
  • Update macOS support to 10_14.

Multipath Service Type

28 Jul 23:52
e623595
Compare
Choose a tag to compare

The multipath service type determines whether multipath TCP should be attempted and the conditions for creating and switching between subflows. Using these service types requires the appropriate entitlement. Any connection attempt will fail if the process does not have the required entitlement.

Available options are:

  • .none - The default service type indicating that Multipath TCP should not be used.
  • .handover - A Multipath TCP service that provides seamless handover between Wi-Fi and cellular in order to preserve the connection.
  • .interactive - A service whereby Multipath TCP attempts to use the lowest-latency interface.
  • .aggregate - A service that aggregates the capacities of other Multipath options in an attempt to increase throughput and minimize latency.

Cleanup

29 Mar 21:06
bbe8f6d
Compare
Choose a tag to compare
  • Remove forgotten debug code.

Logging & Metrics

22 Mar 18:11
6f10ae0
Compare
Choose a tag to compare

This version of Atom adds the ability to log all network requests to the Console app as well as export all logs to a file.

To take advantage of this new feature, set log property on Atom instance to .on:

let atom: Atom = {
    let atom = Atom()
    atom.log = .on

    return atom
}()

Current implementation uses os_log.

If you choose to use the Console app for monitoring outgoing requests, you can use the following categories and subsystems to filter results.

Categories: Network, Authentication.
Subsystems: Your App’s Bundle Identifier.

Changelog

  • Add and implement required OSLog options.
  • Add and implement required additions to Bool, URLRequest, URLResponse, URLSessionTask, URLSessionTaskMetrics.
  • Introduce and implement Interceptor type.
  • Update implementation of the Service and AuthenticationManager to use new Interceptor for logging requests to the Console.
  • Update the Example app.
  • Update documentation.