{"id":463147,"date":"2025-06-13T09:39:38","date_gmt":"2025-06-13T09:39:38","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=463147"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=463147","title":{"rendered":"<span>CherryPick DI \u0434\u043b\u044f Dart\/Flutter \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e?<\/h2>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/681714\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 CherryPick: \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b (Scope, Module, Binding), \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 Dart\/Flutter. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 Flutter \u0438 CherryPick \u2014 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0432\u044b\u0431\u043e\u0440<\/h3>\n<p>Flutter \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438: \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432, \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u0442\u0435\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0435\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438. CherryPick \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0438 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u043d\u044b\u0435 Scope \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u00ab\u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0436\u0438\u0437\u043d\u0438\u00bb (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u043a\u0440\u0430\u043d\u0430) \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u0451\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439, \u043d\u043e \u043c\u043e\u0449\u043d\u044b\u0439 API \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0438 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043d\u0438\u0436\u0430\u0435\u0442 \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u043c\u0435\u043d\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0411\u044b\u0441\u0442\u0440\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f CherryPick c Flutter<\/h3>\n<h4>1. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b<\/h4>\n<p>\u0412 <code>pubspec.yaml<\/code>:<\/p>\n<pre><code class=\"yaml\">dependencies:   cherrypick: ^2.0.0   cherrypick_annotations: ^1.1.0-dev.0   cherrypick_flutter: ^1.1.0  dev_dependencies:   cherrypick_generator: ^1.1.0-dev.0   build_runner: ^2.4.15 <\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435:<\/p>\n<pre><code>flutter pub get<\/code><\/pre>\n<h4>2. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c DI-\u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438<\/h4>\n<p>CherryPick \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u2014 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0441\u0432\u043e\u0451\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438, \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0437\u0430 \u0432\u0430\u0441 \u043d\u0443\u0436\u043d\u044b\u0439 boilerplate.<\/p>\n<pre><code class=\"dart\">import 'package:cherrypick_annotations\/cherrypick_annotations.dart'; import 'package:cherrypick\/cherrypick.dart';  @module() abstract class AppModule extends Module {   @singleton()   ApiClient apiClient() =&gt; ApiClient();    @provide()   AuthRepository repository(ApiClient api) =&gt; AuthRepository(api);    @provide()   String greeting(@params() String name) =&gt; '\u041f\u0440\u0438\u0432\u0435\u0442, $name!'; } <\/code><\/pre>\n<h4>3. \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438<\/h4>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code>flutter pub run build_runner build <\/code><\/pre>\n<p>\u0411\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>$AppModule<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u0430\u0448 AppModule \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438 \u0434\u043b\u044f DI.<\/p>\n<h4>4. \u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u0432\u043e Flutter \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CherryPickProvider<\/h4>\n<p>\u0412 \u0442\u043e\u0447\u043a\u0435 \u0432\u0445\u043e\u0434\u0430 (\u043e\u0431\u044b\u0447\u043d\u043e \u0432 <code>main.dart<\/code>):<\/p>\n<pre><code class=\"dart\">import 'package:flutter\/material.dart'; import 'package:cherrypick_flutter\/cherrypick_flutter.dart'; import 'app_module.cherrypick.g.dart'; \/\/ \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c  void main() {   CherryPick.openRootScope().installModules([     $AppModule(),   ]);   runApp(     CherryPickProvider(       child: MyApp(),     ),   ); } <\/code><\/pre>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>CherryPickProvider<\/code> \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 rootScope \u0438 \u0434\u0430\u0451\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0441\u044c widget tree.<\/p>\n<h4>5. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0430\u0445<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0434\u0436\u0435\u0442\u0430, \u0432\u044b\u0437\u043e\u0432\u0438\u0442\u0435:<\/p>\n<pre><code class=\"dart\">class MyWidget extends StatelessWidget {   @override   Widget build(BuildContext context) {     final rootScope = CherryPickProvider.of(context).openRootScope();      final greeting = rootScope.resolve&lt;String&gt;();     final repo = rootScope.resolve();      return Text(greeting);   } } <\/code><\/pre>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u043e\u0434-Scopes \u0434\u043b\u044f \u044d\u043a\u0440\u0430\u043d\u0430<\/h3>\n<p>\u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 Scope&#8217;\u044b \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438):<\/p>\n<pre><code class=\"dart\">final screenScope = CherryPickProvider.of(context).openSubScope(scopeName: 'myScreen'); screenScope.installModules([MyFeatureModule()]); <\/code><\/pre>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u043e\u0432<\/h3>\n<p>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0440\u0443\u0447\u043d\u043e\u0439 \u00ab\u0441\u0431\u043e\u0440\u043a\u0438\u00bb \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u043d\u0438\u043a\u0430\u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0430 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u0435\u0439 \u043a\u043e\u0434\u0430). \u0412\u044b \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p><code>@singleton<\/code> \u2014 \u0431\u0438\u043d\u0434\u0438\u043d\u0433 singleton&#8217;\u0430, \u0436\u0438\u0432\u0451\u0442 \u0432\u043e \u0432\u0441\u0451\u043c Scope.<\/p>\n<\/li>\n<li>\n<p><code>@provide<\/code> \u2014 \u0431\u0438\u043d\u0434\u0438\u043d\u0433 \u0447\u0435\u0440\u0435\u0437 toProvide().<\/p>\n<\/li>\n<li>\n<p><code>@instance<\/code> \u2014 \u0431\u0438\u043d\u0434\u0438\u043d\u0433 \u0447\u0435\u0440\u0435\u0437 toInstance().<\/p>\n<\/li>\n<li>\n<p><code>@named('\u0438\u043c\u044f')<\/code> \u2014 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u043a \u043a\u043b\u044e\u0447\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0432 DI \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e String \u0438\u043b\u0438 int).<\/p>\n<\/li>\n<li>\n<p><code>@params<\/code> \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0430\u0451\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f resolve.<\/p>\n<\/li>\n<\/ul>\n<p><code>cherrypick_generator<\/code> \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"dart\">final class $AppModule extends AppModule {   @override   void builder(Scope currentScope) {     bind&lt;A&gt;().toProvide(() =&gt; apiClient()).singleton();     bind&lt;B&gt;().toProvide(() =&gt; repository(currentScope.resolve()));     bind&lt;C&gt;().toProvideWithParams((args) =&gt; greeting(args));   } } <\/code><\/pre>\n<h3>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440: \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 DI<\/h3>\n<pre><code class=\"dart\">\/\/ \u0412 AppModule \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c RouterModule @singleton() AppRouter router() =&gt; AppRouter();  class MyApp extends StatelessWidget {   @override   Widget build(BuildContext context) {     final rootScope = CherryPickProvider.of(context).openRootScope();     return MaterialApp.router(       routerDelegate: rootScope.resolve().delegate(),       routeInformationParser: rootScope.resolve().defaultRouteParser(),     );   } } <\/code><\/pre>\n<h3>\u041a\u0430\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 CherryPick<\/h3>\n<p>CherryPick \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438\/\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u0441\u0442\u0430. \u041f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 Scope, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0442\u0443\u0434\u0430 mock-\u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438:<\/p>\n<pre><code class=\"dart\">final testScope = CherryPick.openRootScope()   ..installModules([TestModule()]); final service = testScope.resolve(); <\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>CherryPick \u2014 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 DI-\u0441\u0442\u0435\u043a \u0434\u043b\u044f Flutter \u0438  Dart: \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439, \u0441 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 runtime-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u0434\u0430 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u0432 \u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<br \/> \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432 pet-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0438 production.<\/p>\n<ul>\n<li>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f: <a href=\"https:\/\/github.com\/pese-git\/cherrypick\/tree\/annotations\" rel=\"noopener noreferrer nofollow\">README.md<\/a><\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b: <a href=\"https:\/\/github.com\/pese-git\/cherrypick\/tree\/annotations\" rel=\"noopener noreferrer nofollow\">CherryPick \u043d\u0430 GitHub<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441\u044b \u0438 PR \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f!<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/911938\/\"> https:\/\/habr.com\/ru\/articles\/911938\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0427\u0442\u043e \u043d\u043e\u0432\u043e\u0433\u043e?<\/h2>\n<p>\u0412 <a href=\"https:\/\/habr.com\/ru\/articles\/681714\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435<\/a> \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0440\u0430\u0431\u043e\u0442\u044b DI-\u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0430 CherryPick: \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u0443, \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b (Scope, Module, Binding), \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 Dart\/Flutter. \u0421\u0435\u0433\u043e\u0434\u043d\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445.<\/p>\n<h3>\u041f\u043e\u0447\u0435\u043c\u0443 Flutter \u0438 CherryPick \u2014 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0432\u044b\u0431\u043e\u0440<\/h3>\n<p>Flutter \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0430\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u043e\u0432\u044f\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438: \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u044d\u043a\u0440\u0430\u043d\u043e\u0432, \u0432\u0438\u0434\u0436\u0435\u0442\u043e\u0432, \u0441\u0435\u0440\u0432\u0438\u0441\u043e\u0432. \u0427\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u2014 \u0442\u0435\u043c \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0435\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0432 \u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435 \u043a \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044e \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438. CherryPick \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442:<\/p>\n<ul>\n<li>\n<p>\u0421\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u044b\u0435 \u0438 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0447\u043d\u044b\u0435 Scope \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u00ab\u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0436\u0438\u0437\u043d\u0438\u00bb (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u044d\u043a\u0440\u0430\u043d\u0430) \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<\/li>\n<li>\n<p>\u0414\u0430\u0451\u0442 \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439, \u043d\u043e \u043c\u043e\u0449\u043d\u044b\u0439 API \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u0442 \u0435\u0433\u043e \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438 \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u043a\u043e\u0434\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043d\u0435\u0434\u0440\u044f\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0438 \u0432 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u043e\u043c \u0440\u0435\u0436\u0438\u043c\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0421\u043d\u0438\u0436\u0430\u0435\u0442 \u0441\u0432\u044f\u0437\u043d\u043e\u0441\u0442\u044c, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043f\u043e\u0434\u043c\u0435\u043d\u0443 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0411\u044b\u0441\u0442\u0440\u0430\u044f \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f CherryPick c Flutter<\/h3>\n<h4>1. \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0430\u043a\u0435\u0442\u044b<\/h4>\n<p>\u0412 <code>pubspec.yaml<\/code>:<\/p>\n<pre><code class=\"yaml\">dependencies:   cherrypick: ^2.0.0   cherrypick_annotations: ^1.1.0-dev.0   cherrypick_flutter: ^1.1.0  dev_dependencies:   cherrypick_generator: ^1.1.0-dev.0   build_runner: ^2.4.15 <\/code><\/pre>\n<p>\u0412\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435:<\/p>\n<pre><code>flutter pub get<\/code><\/pre>\n<h4>2. \u041e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c DI-\u043c\u043e\u0434\u0443\u043b\u044c \u0441 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438<\/h4>\n<p>CherryPick \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u2014 \u0432\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432 \u0441\u0432\u043e\u0451\u043c \u043c\u043e\u0434\u0443\u043b\u0435 \u0430\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u044f\u043c\u0438, \u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0441\u043e\u0437\u0434\u0430\u0441\u0442 \u0437\u0430 \u0432\u0430\u0441 \u043d\u0443\u0436\u043d\u044b\u0439 boilerplate.<\/p>\n<pre><code class=\"dart\">import 'package:cherrypick_annotations\/cherrypick_annotations.dart'; import 'package:cherrypick\/cherrypick.dart';  @module() abstract class AppModule extends Module {   @singleton()   ApiClient apiClient() =&gt; ApiClient();    @provide()   AuthRepository repository(ApiClient api) =&gt; AuthRepository(api);    @provide()   String greeting(@params() String name) =&gt; '\u041f\u0440\u0438\u0432\u0435\u0442, $name!'; } <\/code><\/pre>\n<h4>3. \u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438<\/h4>\n<p>\u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code>flutter pub run build_runner build <\/code><\/pre>\n<p>\u0411\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 <code>$AppModule<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0432\u0430\u0448 AppModule \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043d\u0443\u0436\u043d\u044b\u0435 \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u0438 \u0434\u043b\u044f DI.<\/p>\n<h4>4. \u0418\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u0432\u043e Flutter \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e CherryPickProvider<\/h4>\n<p>\u0412 \u0442\u043e\u0447\u043a\u0435 \u0432\u0445\u043e\u0434\u0430 (\u043e\u0431\u044b\u0447\u043d\u043e \u0432 <code>main.dart<\/code>):<\/p>\n<pre><code class=\"dart\">import 'package:flutter\/material.dart'; import 'package:cherrypick_flutter\/cherrypick_flutter.dart'; import 'app_module.cherrypick.g.dart'; \/\/ \u0418\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c  void main() {   CherryPick.openRootScope().installModules([     $AppModule(),   ]);   runApp(     CherryPickProvider(       child: MyApp(),     ),   ); } <\/code><\/pre>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>CherryPickProvider<\/code> \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0438\u0440\u0443\u0435\u0442 rootScope \u0438 \u0434\u0430\u0451\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c \u0447\u0435\u0440\u0435\u0437 \u0432\u0435\u0441\u044c widget tree.<\/p>\n<h4>5. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432 \u0432\u0438\u0434\u0436\u0435\u0442\u0430\u0445<\/h4>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u043d\u0443\u0442\u0440\u0438 \u0432\u0438\u0434\u0436\u0435\u0442\u0430, \u0432\u044b\u0437\u043e\u0432\u0438\u0442\u0435:<\/p>\n<pre><code class=\"dart\">class MyWidget extends StatelessWidget {   @override   Widget build(BuildContext context) {     final rootScope = CherryPickProvider.of(context).openRootScope();      final greeting = rootScope.resolve&lt;String&gt;();     final repo = rootScope.resolve();      return Text(greeting);   } } <\/code><\/pre>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0451\u043c \u043f\u043e\u0434-Scopes \u0434\u043b\u044f \u044d\u043a\u0440\u0430\u043d\u0430<\/h3>\n<p>\u041c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 Scope&#8217;\u044b \u0434\u043b\u044f \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0445 \u043e\u0431\u043b\u0430\u0441\u0442\u0435\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0438):<\/p>\n<pre><code class=\"dart\">final screenScope = CherryPickProvider.of(context).openSubScope(scopeName: 'myScreen'); screenScope.installModules([MyFeatureModule()]); <\/code><\/pre>\n<h3>\u041a\u0430\u043a \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044f \u0431\u0438\u043d\u0434\u0438\u043d\u0433\u043e\u0432<\/h3>\n<p>\u0410\u043d\u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0440\u0443\u0447\u043d\u043e\u0439 \u00ab\u0441\u0431\u043e\u0440\u043a\u0438\u00bb \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 (\u043d\u0438\u043a\u0430\u043a\u0430\u043a\u043e\u0433\u043e \u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0430 \u0438 \u043f\u0440\u043e\u0441\u0442\u044b\u043d\u0435\u0439 \u043a\u043e\u0434\u0430). \u0412\u044b \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b:<\/p>\n<ul>\n<li>\n<p><code>@singleton<\/code> \u2014 \u0431\u0438\u043d\u0434\u0438\u043d\u0433 singleton&#8217;\u0430, \u0436\u0438\u0432\u0451\u0442 \u0432\u043e \u0432\u0441\u0451\u043c Scope.<\/p>\n<\/li>\n<li>\n<p><code>@provide<\/code> \u2014 \u0431\u0438\u043d\u0434\u0438\u043d\u0433 \u0447\u0435\u0440\u0435\u0437 toProvide().<\/p>\n<\/li>\n<li>\n<p><code>@instance<\/code> \u2014 \u0431\u0438\u043d\u0434\u0438\u043d\u0433 \u0447\u0435\u0440\u0435\u0437 toInstance().<\/p>\n<\/li>\n<li>\n<p><code>@named('\u0438\u043c\u044f')<\/code> \u2014 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u043a \u043a\u043b\u044e\u0447\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u0433\u0434\u0430 \u0432 DI \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e String \u0438\u043b\u0438 int).<\/p>\n<\/li>\n<li>\n<p><code>@params<\/code> \u2014 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0434\u0430\u0451\u0442\u0441\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u043e \u0432\u0440\u0435\u043c\u044f resolve.<\/p>\n<\/li>\n<\/ul>\n<p><code>cherrypick_generator<\/code> \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0432\u0430\u0448 \u043c\u043e\u0434\u0443\u043b\u044c \u0432 \u043a\u043e\u0434 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u0438\u0434\u0430:<\/p>\n<pre><code class=\"dart\">final class $AppModule extends AppModule {   @override   void builder(Scope currentScope) {     bind&lt;A&gt;().toProvide(() =&gt; apiClient()).singleton();     bind&lt;B&gt;().toProvide(() =&gt; repository(currentScope.resolve()));     bind&lt;C&gt;().toProvideWithParams((args) =&gt; greeting(args));   } } <\/code><\/pre>\n<h3>\u0415\u0449\u0435 \u043e\u0434\u0438\u043d \u043f\u0440\u0438\u043c\u0435\u0440: \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0440\u043e\u0443\u0442\u0435\u0440\u0430 \u0447\u0435\u0440\u0435\u0437 DI<\/h3>\n<pre><code class=\"dart\">\/\/ \u0412 AppModule \u0438\u043b\u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c RouterModule @singleton() AppRouter router() =&gt; AppRouter();  class MyApp extends StatelessWidget {   @override   Widget build(BuildContext context) {     final rootScope = CherryPickProvider.of(context).openRootScope();     return MaterialApp.router(       routerDelegate: rootScope.resolve().delegate(),       routeInformationParser: rootScope.resolve().defaultRouteParser(),     );   } } <\/code><\/pre>\n<h3>\u041a\u0430\u043a \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441 CherryPick<\/h3>\n<p>CherryPick \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043b\u0435\u0433\u043a\u043e \u043f\u043e\u0434\u043c\u0435\u043d\u044f\u0442\u044c \u043c\u043e\u0434\u0443\u043b\u0438\/\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430 \u0432\u0440\u0435\u043c\u044f \u0442\u0435\u0441\u0442\u0430. \u041f\u0440\u043e\u0441\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 Scope, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0435 \u0442\u0443\u0434\u0430 mock-\u043c\u043e\u0434\u0443\u043b\u044c \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0439\u0442\u0435 \u0432 \u0438\u0437\u043e\u043b\u044f\u0446\u0438\u0438:<\/p>\n<pre><code class=\"dart\">final testScope = CherryPick.openRootScope()   ..installModules([TestModule()]); final service = testScope.resolve(); <\/code><\/pre>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>CherryPick \u2014 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0439 DI-\u0441\u0442\u0435\u043a \u0434\u043b\u044f Flutter \u0438  Dart: \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439, \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u0435\u043c\u044b\u0439, \u0441 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439, \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 runtime-\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u043e\u0432, \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u043a\u043e\u0434\u0430 \u0438 \u0443\u0434\u043e\u0431\u043d\u043e\u0439 \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0435\u0439 \u0432 \u043b\u044e\u0431\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<br \/> \u0420\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0432 pet-\u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 \u0438 production.<\/p>\n<ul>\n<li>\n<p>\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f: <a href=\"https:\/\/github.com\/pese-git\/cherrypick\/tree\/annotations\" rel=\"noopener noreferrer nofollow\">README.md<\/a><\/p>\n<\/li>\n<li>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b: <a href=\"https:\/\/github.com\/pese-git\/cherrypick\/tree\/annotations\" rel=\"noopener noreferrer nofollow\">CherryPick \u043d\u0430 GitHub<\/a><\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u043f\u0440\u043e\u0441\u044b \u0438 PR \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f!<\/p>\n<\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/911938\/\"> https:\/\/habr.com\/ru\/articles\/911938\/<\/a><br \/><\/br><\/br><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-463147","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/463147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=463147"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/463147\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=463147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=463147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=463147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}