p-hatan/ mirror

pub repository

mirror.p-hatan.ir

frontend_server_client

4.2.0

Client code to start and interact with the frontend_server compiler from the Dart SDK.

Download archive

Readme

pub package package publisher

This package provides a client interface around the frontend_server compiler which ships with the Dart SDK. It is highly dependent on the SDK's version and thus should only be used within the SDK or for specific tools that need to interact with our compilers.

Version restrictions

Every SDK artifact discovered by or passed to package:frontend_server_client needs to have come from the same build, and the version of package:frontend_server_client being used must support that SDK version.

Serving DDC apps

To serve an app compiled by DDC in its library bundle format, use DartDevcFrontendServerClient, DdcLibraryBundleSdkAssets, and generateDdcLibraryBundle*:

  • Start DartDevcFrontendServerClient with dartdevcModuleFormat: 'ddc' and canaryFeatures: true.
  • sdkRoot in both DartDevcFrontendServerClient.start and DdcLibraryBundleSdkAssets.load default to the running SDK's directory but must be overridden for AoT-compiled apps.
  • Call DdcLibraryBundleSdkAssets.load from your package root. dart_sdk.js is compiled on first use and cached in .dart_tool/frontend_server_client.
  • To use a prebuilt dart_sdk.js instead, pass its path to DdcLibraryBundleSdkAssets.load via sdkJsPath. Compile it with sdkRoot's DDC using --modules=ddc --canary, and place its source map at <sdkJsPath>.map.
Changelog

4.2.0

  • Support the DDC library bundle format and allow Frontend Server-driven hot reload, hot restart, and expression compilation.
  • Add helpers for app bootstrapping.

4.1.0

  • Support running from standalone CLI executables and respect sdkRoot when locating SDK tools and snapshots.
  • Update Dart SDK constraint to ^3.10.0.
  • Allow package_config 3.x.x.

4.0.0

  • Update Dart SDK constraint to ^3.0.0.
  • Support changes in the SDK layout for Dart 3.0.
  • By default, start the frontend server from the AOT snapshot shipped in the Dart SDK.
  • Throw an ArgumentError when FrontendServerClient.start is called with the frontendServerPath argument omitted and the debug argument set to true.
  • Update package:vm_service constraint to ^14.0.0.

3.2.0

  • Add nativeAssets parameter to FrontendServerClient, for passing additional --native-assets to the kernel compiler.

3.1.0

  • Add additionalSources parameter to FrontendServerClient, for passing additional --sources to the kernel compiler.

3.0.0

  • Update the compile api to return a non-null CompileResult, and instead make the dillOutput field nullable. This allows you to still get compiler output if no dill file was produced.

2.1.3

  • Update package:vm_service to version ^8.0.0

2.1.2

  • Force kill the frontend server after one second when calling shutdown. It appears to hang on windows sometimes.

2.1.1

  • Fix a bug where spaces in the output dill path would cause a parse error when reading the error count output.

2.1.0

  • Support enabling experiments when starting the compiler.

2.0.1

  • Widen the upper bound sdk constraint to <3.0.0. The frontend server api is now considered quite stable and this package is now depended on by package:test, so a tight constraint would cause unnecessary headaches.

2.0.0

  • Support null safety.

1.0.0

  • Initial version

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add frontend_server_client
pubspec.yaml
name: frontend_server_client
version: 4.2.0
description: >-
  Client code to start and interact with the frontend_server compiler from the
  Dart SDK.
repository: https://github.com/dart-lang/sdk/tree/main/pkg/frontend_server_client

resolution: workspace

environment:
  sdk: ^3.13.0-0.0.dev

dependencies:
  async: ^2.5.0
  package_config: '>=2.1.0 <4.0.0'
  path: ^1.8.0

dev_dependencies:
  dart_flutter_team_lints: any
  shelf: any
  shelf_packages_handler: any
  shelf_static: any
  test: any
  test_descriptor: any
  test_process: any
  vm_service: any

Version history

VersionPublishedArchiveSHA-256
1.0.02020-11-30T21:56:55.265828ZDownload30e76bfa3a13629624320a6f134c1e720b2ddb5ae884d15780c446d42636c599
2.0.02021-03-10T17:48:05.042009ZDownloadd341751c4aefe55144d17bb150d261e8e085d6b1b7fe79b0956d3405bf61fe75
2.1.02021-04-29T16:22:36.176866ZDownload780784ec9e9362ed5278272d39b6590474dba495483ec97eba31df4d23622fa0
2.1.12021-08-16T18:26:18.252030ZDownload8cab40f1feaff5bc7b6a6aa71937f4829a36857b9d7752f563290cc563c1a84b
2.1.22021-08-19T14:52:18.456651ZDownload6d2930621b9377f6a4b7d260fce525d48dd77a334f0d5d4177d07b0dcb76c032
2.1.32022-05-16T21:49:25.045426ZDownload4f4a162323c86ffc1245765cfe138872b8f069deb42f7dbb36115fa27f31469b
3.0.02022-08-18T14:38:17.317637ZDownload01fb90a581ee2bbca0a1c72b04f73b5e9e89b89bf608c9dfa815ea9cec00f11c
3.1.02022-10-20T17:54:51.708546ZDownload82715f8041a85a534a7bf64400b2ee0bb3d594ccf695d97c0bb017259657ff5d
3.2.02022-11-24T14:52:35.844604ZDownload408e3ca148b31c20282ad6f37ebfa6f4bdc8fede5b74bc2f08d9d92b55db3612
4.0.02024-03-26T17:36:08.504889ZDownloadf64a0333a82f30b0cca061bc3d143813a486dc086b574bfb233b7c1372427694
4.1.02026-10-02T13:20:20.211955ZDownload404dbf9bce29beafbe9dcb19219447b6f7d49900cd42b8d3b7af102b24508e25
4.2.02026-10-20T23:33:28.463507ZDownload2b56423afc7651a81da53ed3a4f9f51e92572293f54d0d54e19b759f13714849

Dependencies

async "^2.5.0"

package_config "\u003e=2.1.0 \u003c4.0.0"

path "^1.8.0"