Skip to content

feat: Add swift wasm CI targets to DataLoader #26

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ jobs:
test:
uses: graphqlswift/ci/.github/workflows/test.yaml@main
with:
include_android: false
include_android: false
24 changes: 24 additions & 0 deletions .github/workflows/wasm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: wasm

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:

jobs:
# NOTE: swift tests won't compile due to usage
# of NIOPosix. But we can at least test that wasm compilation
# works, to prevent future breakages.
wasm:
name: Test wasm compilation
runs-on: ubuntu-latest
container: swift:6.1.0
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: swiftwasm/setup-swiftwasm@v2
with:
target: "wasm32-unknown-wasip1-threads"
- run: swift build --swift-sdk wasm32-unknown-wasip1-threads
13 changes: 7 additions & 6 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.8
// swift-tools-version:5.10.0
// The swift-tools-version declares the minimum version of Swift required to build this package.
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, this is likely a breaking change for users of this repository.


import PackageDescription
Expand All @@ -13,7 +13,10 @@ let package = Package(
dependencies: [
.package(url: "https://github.com/apple/swift-algorithms.git", from: "1.0.0"),
.package(url: "https://github.com/adam-fowler/async-collections", from: "0.0.1"),
.package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),

Copy link
Author

@scottmarchant scottmarchant Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR should NOT be merged until apple/swift-nio#3271 is merged and released.

This needs updated with the latest swift nio version once 3271 is merged and in a release.

Copy link
Author

@scottmarchant scottmarchant Jun 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nio PR is merged now, but still need a new swift-nio release containing the change. Until then, can't have a new minimum version with correct Package.resolved values.

// TODO: SM: Revert before merging. Temporarily using PL nio to test fix for NIOCore.
// .package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),
.package(url: "https://github.com/PassiveLogic/swift-nio.git", branch: "main"),
],
targets: [
.target(
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![](https://img.shields.io/badge/License-MIT-blue.svg?style=flat)](https://tldrlegal.com/license/mit-license)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FGraphQLSwift%2FDataLoader%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/GraphQLSwift/DataLoader)
[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FGraphQLSwift%2FDataLoader%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/GraphQLSwift/DataLoader)
[![WASI 0.1](https://github.com/GraphQLSwift/DataLoader/actions/workflows/wasm.yml/badge.svg?branch=main)](https://github.com/GraphQLSwift/DataLoader/actions/workflows/wasm.yml)

DataLoader is a generic utility to be used as part of your application's data fetching layer to provide a simplified and consistent API over various remote data sources such as databases or web services via batching and caching.

Expand Down
Loading