Skip to content

chore(repo): repository preparation prerequisites - #5

Merged
gabriel-sisjr merged 8 commits into
developfrom
feature/repo-prep
Jun 15, 2026
Merged

chore(repo): repository preparation prerequisites#5
gabriel-sisjr merged 8 commits into
developfrom
feature/repo-prep

Conversation

@gabriel-sisjr

Copy link
Copy Markdown
Owner

Summary

This PR is a round of repository hardening that lands before feature work begins. It restores green iOS CI, aligns the Android retry-jitter implementation with the JS and iOS engines, tightens tooling/DX, makes CI the sole publisher of the package, and refreshes the documentation that drifted from the current codebase.

No public API change. This is library-internal repo prep. The public TypeScript/JS API surface (src/index.tsx facade — 19 functions, 2 listener helpers, 7 hooks, the SyncProvider context, and SyncErrorCode) is unchanged. The only consumer-facing change is a platform requirement: the iOS deployment floor moves from 13.0 to 15.0 (see Reviewer notes / risk).

What & Why

iOS build / CI correctness

  • Demote Core Data entities to internal. SyncItemEntity / SyncResultEntity were declared public, so they leaked into the generated Swift bridging header and broke Obj-C translation units (Cannot find interface declaration for NSManagedObject), failing the iOS CI build. They (and their members) are now internal — implementation-only, no public-API impact. The example AppDelegate was updated to call the renamed HybridSyncProvider.handleBackgroundURLSessionEvents.
  • Raise the minimum deployment target to iOS 15.0. ios/HTTP/SyncDispatcher.swift already uses URLSession.data(for:) (iOS 15+). The old 13.0 podspec floor only compiled because the example app overrode IPHONEOS_DEPLOYMENT_TARGET; consumers honoring the declared 13.0 floor would hit an availability compile error. The podspec floor (both s.platforms and test_spec.platforms) is now 15.0, and the now-always-true #available(iOS 13.0) / @available(iOS 13.0) guards in SyncDispatcher.swift and BackgroundSyncManager.swift were removed as dead code.

Android retry-jitter correctness

  • Align Android jitter to equal-jitter [0.75, 1.25). The Android RetryPolicyEvaluator previously applied full jitter over [0, capped] and capped before jittering, collapsing delays toward 0 and diverging from the other two engines. It now jitters the raw delay (raw * (0.75 + random.nextDouble() * 0.5)) and caps afterwards, matching JS (src/utils/retryBackoff.ts) and iOS (ios/Retry/RetryPolicyEvaluator.swift). The RetryPolicy TSDoc in src/types/sync.ts was aligned and seeded-Random unit tests were added.

Tooling / DX

  • Tighten lint/tsc/turbo config. ESLint now ignores nitrogen/, website/build/, website/.docusaurus/, and coverage/. tsconfig.json enables incremental + tsBuildInfoFile (faster pre-commit tsc), while tsconfig.build.json keeps incremental: false. The unused test task was removed from turbo.json.

Release / CI pipeline

  • Make CI the sole publisher. package.json release-it now sets npm.publish: false, so local yarn release only bumps/tags/pushes — CI performs the actual publish (with --provenance), and the version-diff guard works correctly. publish.yml runs yarn lint + yarn typecheck after nitrogen and before the build (fail-fast), and ci.yml adds a report-only npm pack --dry-run package-size summary after yarn prepare.

Documentation

  • Correct stale Nitro facade comments. src/SyncProvider.nitro.ts header now states the JS facade lives wholly in src/index.tsx (no per-method .native.tsx/.tsx split; entry-level web split via the browser exports condition) and that the iOS impl class is HybridSyncProvider (not SyncProvider).
  • Document the iOS 15 floor and add a pre-merge checklist. CHANGELOG.md gains an [Unreleased] section (Changed / Fixed / Internal); BREAKING_CHANGES.md gains an [Unreleased] entry for the iOS 13→15 floor with migration steps; README.md platform tables now read iOS 15; CONTRIBUTING.md adds a V-JS / V-AND / V-IOS pre-merge checklist and corrects the Nitro-method lifecycle (facade lives in src/index.tsx).

How

A few decisions worth a reviewer's attention:

  • Why entities went internal: Nitro's Swift↔C++ interop emits a bridging header; public Core Data subclasses of NSManagedObject forced Obj-C translation units to resolve NSManagedObject, which they cannot. Demoting to internal keeps them out of the header while leaving runtime behaviour identical (they were never part of the public API).
  • Why npm.publish: false: Splitting "version + tag + push" (local, via yarn release) from "publish" (CI only) makes CI the single source of truth for what ships, lets us publish with --provenance, and keeps the version-diff guard reliable — a local accidental publish can no longer race CI.
  • Why remove the #available guards: With the floor at iOS 15, the iOS 13.0 checks are statically always-true; leaving them in implies a 13.0 path that no longer exists.
  • Jitter ordering: capping after jitter (not before) is the load-bearing fix — it preserves the spread of the backoff distribution instead of clamping it toward zero.

Testing

V-JS gate — run locally, green ✅

  • yarn typecheckPASS
  • yarn lintPASS (0 errors; 25 pre-existing warnings in untouched hooks/contexts/website)
  • yarn test13 suites / 71 tests pass
  • JSON / YAML files structurally validated
  • release-it.npm.publish === false confirmed
  • Android jitter parity confirmed directly against JS (retryBackoff.ts) and iOS (RetryPolicyEvaluator.swift)

SyncItemEntity/SyncResultEntity were public and leaked into the Swift bridging header, breaking
Obj-C translation and the iOS CI build. AppDelegate now calls
HybridSyncProvider.handleBackgroundURLSessionEvents.
podspec floor 13.0 -> 15.0 to match URLSession.data(for:) (iOS 15+) used in SyncDispatcher.
Removed the always-true iOS 13 availability guards as dead code.
Android RetryPolicyEvaluator applied full-jitter and capped before jittering; now jitters the raw
delay by [0.75, 1.25) then caps, matching JS/iOS. Aligned the RetryPolicy TSDoc and added
seeded-Random tests.
The spec header now states the JS facade lives wholly in src/index.tsx (no per-method
.native.tsx/.tsx split) and the iOS impl is HybridSyncProvider, not SyncProvider.
eslint now ignores nitrogen/, website/build, website/.docusaurus and coverage/. tsconfig enables
incremental builds (build config opts out). Removed the unused turbo test task.
release-it npm.publish=false so only CI publishes (with provenance). publish.yml runs lint+typecheck
before the build; ci.yml reports the npm pack size in the job summary.
CHANGELOG [Unreleased] and a BREAKING_CHANGES entry for the iOS 13->15 floor; README platform
tables updated to iOS 15. CONTRIBUTING gains a V-JS/V-AND/V-IOS pre-merge checklist and a corrected
facade lifecycle.
@gabriel-sisjr gabriel-sisjr self-assigned this Jun 12, 2026
@gabriel-sisjr gabriel-sisjr added platform: ios iOS-specific issue or change. area: native Native module or bridge layer. area: example Example app or demo project. docs: improvement Improving clarity, structure, or examples in documentation. labels Jun 12, 2026
@gabriel-sisjr
gabriel-sisjr merged commit a76c5eb into develop Jun 15, 2026
7 of 9 checks passed
@gabriel-sisjr
gabriel-sisjr deleted the feature/repo-prep branch June 15, 2026 23:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: example Example app or demo project. area: native Native module or bridge layer. docs: improvement Improving clarity, structure, or examples in documentation. platform: ios iOS-specific issue or change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant