Files
Tony 05ccef7e81
Deploy Artifact Proxy Dev / ☁️ Artifact Proxy (push) Has been cancelled
Deploy Discord GCP Alerts / ☁️ Discord GCP Alerts (push) Has been cancelled
ci / 📄 License Check (push) Has been cancelled
ci / ✅ Semantic Pull Request (push) Has been cancelled
ci / 🔤 Check Spelling (push) Has been cancelled
ci / 👀 Detect Changes (push) Has been cancelled
Shorebird CI / changes (push) Has been cancelled
Shorebird CI / CSpell (push) Has been cancelled
ci / 🎯 Build ${{ matrix.package }} (${{ matrix.os }}) (push) Has been cancelled
ci / 🔎 Verify ${{ matrix.package }} (push) Has been cancelled
ci / ci (push) Has been cancelled
Shorebird CI / artifact_proxy (push) Has been cancelled
Shorebird CI / dex (push) Has been cancelled
Shorebird CI / discord_gcp_alerts (push) Has been cancelled
Shorebird CI / flutter_version_resolver (push) Has been cancelled
Shorebird CI / jwt (push) Has been cancelled
Shorebird CI / scoped_deps (push) Has been cancelled
Shorebird CI / shorebird_build_trace (push) Has been cancelled
Shorebird CI / shorebird_ci (push) Has been cancelled
Shorebird CI / shorebird_cli (push) Has been cancelled
Shorebird CI / shorebird_code_push_client (push) Has been cancelled
Shorebird CI / shorebird_code_push_protocol (push) Has been cancelled
Shorebird CI / shorebird_redis_client (push) Has been cancelled
Shorebird CI / stripe_api (push) Has been cancelled
Shorebird CI / required (push) Has been cancelled
ci / 🎯 Build ${{ matrix.package }} (push) Has been cancelled
Merge remote-tracking branch 'upstream/main'
# Conflicts:
#	packages/artifact_proxy/lib/src/artifact_proxy.dart
#	packages/scoped_deps/pubspec.yaml
#	packages/shorebird_cli/pubspec.yaml
#	packages/shorebird_code_push_client/lib/src/code_push_client.dart
2026-08-03 01:58:32 +08:00
..

Scoped Deps

A simple dependency injection library built on Zones.

Status: vendored, no longer published by Shorebird

Felix Angelov wrote this package in 2023 (originally package:scoped) so that our packages could share one dependency-injection mechanism. We published it to pub.dev in 2024 in case it was useful to others, then never needed to change it again.

In 2026, Morgan Hunt (mrgnhnt96/scoped_deps) approached us about taking over the pub.dev package and continuing to improve it, and we accepted. scoped_deps on pub.dev is now his, and its versions have diverged from this directory.

Shorebird packages keep using this vendored copy, resolved through the Dart workspace rather than from pub.dev. The code hasn't meaningfully changed in two years, so there's nothing to gain from moving right now. At some point we should look at where the pub.dev package has evolved to and consider deleting this copy in favor of it.

Quick Start

import 'package:scoped_deps/scoped_deps.dart';

final value = create(() => 42);

void main() {
  runScoped(scopeA, values: {value});
}

void scopeA() {
  print(read(value)); // 42
  runScoped(scopeB, values: {value.overrideWith(() => 0)});
}

void scopeB() {
  print(read(value)); // 0
}