Skip to content

impl ios library#1

Merged
seokju-na merged 7 commits into
mainfrom
works
Jun 14, 2026
Merged

impl ios library#1
seokju-na merged 7 commits into
mainfrom
works

Conversation

@seokju-na

@seokju-na seokju-na commented Jun 14, 2026

Copy link
Copy Markdown
Member

Summary by cubic

Implements the iOS WebViewBundle Swift library to serve .wvb bundles in WKWebView via custom URL schemes, adds a Tuist TestApp, and wires unit + Appium/Vitest E2E tests into CI.

  • New Features

    • WebViewBundle registers WKURLSchemeHandler, builds configured WKWebViews, exposes schemes, and supports onError.
    • WebViewBundleProtocol adds .bundle(scheme:) and .local(scheme:hosts:) with empty/invalid/reserved/duplicate scheme checks.
    • BundleSource.make provides iOS/macOS defaults and creates a writable Application Support dir scoped by bundle id.
    • Async scheme handler bridges UniFFI; includes HttpMethod.from and HttpResponseHTTPURLResponse helpers.
    • High-level config (WebViewBundleConfig, WebViewBundleUpdaterConfig, WebViewBundleRemoteConfig) with webViewBundle(_:)/wvb(_:) optionally wiring Remote/Updater.
    • TestApp serves testapp://hacker-news.wvb; unit tests cover serving/validation; E2E runs via Appium/Vitest; CI runs swift test and E2E on macOS.
  • Dependencies

    • Package.swift pins WebViewBundleFFI to prerelease/4513cab with checksum, sets swift-tools-version to 6.1, and links SystemConfiguration, Security, and CoreFoundation.

Written for commit 1d1651f. Summary will update on new commits.

Review in cubic

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

4 issues found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Sources/WebViewBundle/WebViewBundleSchemeHandler.swift">

<violation number="1" location="Sources/WebViewBundle/WebViewBundleSchemeHandler.swift:45">
P2: Stopped scheme tasks are not actually cancelled. This can waste work and still run request-side effects after `stop` is called.</violation>
</file>

<file name="Sources/WebViewBundle/WebViewBundle.swift">

<violation number="1" location="Sources/WebViewBundle/WebViewBundle.swift:49">
P1: Scheme validation is incomplete: non-empty but native/invalid schemes are accepted and can crash at handler registration.</violation>

<violation number="2" location="Sources/WebViewBundle/WebViewBundle.swift:50">
P2: Duplicate scheme check is case-sensitive; case variants can pass init and fail at runtime during registration.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread Sources/WebViewBundle/WebViewBundle.swift Outdated
Comment thread .github/workflows/ci.yaml

// Inherits the main actor; the `await` lets the FFI handler run off-main
// (it is `nonisolated`) and resumes here back on the main actor.
Task {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: Stopped scheme tasks are not actually cancelled. This can waste work and still run request-side effects after stop is called.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At Sources/WebViewBundle/WebViewBundleSchemeHandler.swift, line 45:

<comment>Stopped scheme tasks are not actually cancelled. This can waste work and still run request-side effects after `stop` is called.</comment>

<file context>
@@ -0,0 +1,83 @@
+
+        // Inherits the main actor; the `await` lets the FFI handler run off-main
+        // (it is `nonisolated`) and resumes here back on the main actor.
+        Task {
+            let result: Result<HttpResponse, any Swift.Error>
+            do {
</file context>

Comment thread Sources/WebViewBundle/WebViewBundle.swift Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="Sources/WebViewBundle/WebViewBundleSchemeHandler.swift">

<violation number="1" location="Sources/WebViewBundle/WebViewBundleSchemeHandler.swift:45">
P2: Stopped scheme tasks are not actually cancelled. This can waste work and still run request-side effects after `stop` is called.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread .github/workflows/ci.yaml Outdated
@seokju-na seokju-na changed the title impl library impl ios library Jun 14, 2026
@seokju-na seokju-na merged commit 4785f39 into main Jun 14, 2026
3 checks passed
@seokju-na seokju-na deleted the works branch June 14, 2026 15:05
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.

1 participant