# mojo 0.4.27

Dart files to support executing inside Mojo.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add 'mojo:0.4.27'
```
Published: 2016-07-01T21:39:03.641Z
Expected archive SHA-256: fa9971227457ea62016924ba50b7c158ca7e8fcdc8dca1bc0a1de34d089d0a27
Discontinued upstream.
Available in cache; verification: upstream_checksum
## Direct dependencies

## Package README (untrusted upstream documentation)
Dart Mojo Applications
====

## Mojo Application API

*TODO(zra)*

## Application Packaging

All Dart sources for a Mojo application are collected in a specially formatted
snapshot file, which is understood by Dart's content handler in the Mojo shell.
This section describes what the various parts of that package are, and how they
all make it to the right place.

### GN Template

Dart Mojo applications are built with the GN template 'dart_pkg' defined in
`//mojo/public/dart/rules.gni`. Here is an example:


```
dart_pkg("foo") {
  app_name_override = "dart_foo"
  app = "lib/main.dart"
  sources = [
    "lib/foo.dart",
    "pubspec.yaml",
  ]
  deps = [
    ":foo_mojom",
    "//third_party/dart-pkg",
  ]
}

mojom("foo_mojom") {
  sources = [
    "foo.mojom",
  ]
}
```

There are several parts. See the documentation in `//mojo/public/dart/rules.gni`
for all the details.

### pub packages

Dart Mojo applications may use packages from the pub package repository at
pub.dartlang.org.

The "foo" example above has `uses_pub` set to true. Suppose the "foo" package's
`pubspec.yaml` is as follows:

```
name: foo
version: 0.0.1
description: Foo
dependencies:
  crypto: ">=0.9.0 <0.10.0"
```

The script `//mojo/public/tools/git/dart_pub_get.py` should be run before build
time, e.g. as a "runhooks" action during `gclient sync`. The script traverses
a directory tree looking for `pubspec.yaml` files. On finding one, in the
containing directory, it runs `pub get`. This creates a "packages/" directory
in the source tree adjacent to the `pubspec.yaml` file containing the downloaded
Dart packages. `pub get` also creates a `pubspec.lock` file that locks down
pub packages to specific versions. This `pubspec.lock` file must be checked in
in order to have hermetic builds.

During the build, The `dart_pkg` rule looks for a "packages/" directory, and
ensures that its contents are available when running the application.

### Generated bindings

The script `//mojo/public/tools/bindings/generators/mojom_dart_generator.py`
and the templates under `//mojo/public/tools/bindings/generators/dart_templates`
govern how `.mojom` files are compiled into Dart code.

Consider the `foo.mojom` file used by our example:

```
[DartPackage="foo"]
module foo;

struct Foo {
  int32 code;
  string? description;
};
```

This contents of this file are in the `foo` module. The Dart source generated
for this file will end up under, e.g. `//out/Debug/gen/dart-
pkg/foo/lib/foo/network_error.mojom.dart`, along with the other Dart sources
generated for `.mojom` files with the "foo" `DartPackage` annotation in the
`foo` module.

### Resulting file

The `dart_pkg` rule has two results. The first result is a Dart snapshot file
zipped up into a .mojo file in the build output directory---something like
`//out/Release/foo.mojo`. This file is understood by the Dart content handler
and is suitable for deployment. The second result is a directory layout of the
"foo" app that can be served by a webserver. When the URL of `lib/main.dart` is
given to the `mojo_shell`, the app will be run in the Dart content handler.

They layout for our "foo" example will be the following:

```
//lib/main.dart
//lib/foo.dart
//lib/foo/foo.mojom.dart
//packages/crypto/...  # Dart's crypto pub package.
//packages/mojo/...  # Mojo SDK Dart libraries.
```

Where `//packages/mojo` contains Dart's Mojo bindings, `//packages/crypto`
contains the `crypto` pub package, and `//lib/foo/` contains the bindings
generated for `foo.mojom`.

Mojo's Dart content handler sets the package root for a Dart application to be
the packages directory. Therefore, Dart sources in this application can use the
following imports:

```dart
import 'package:crypto/crypto.dart';
import 'package:foo/foo/foo.mojom.dart';
import 'package:mojo/application.dart';
```

## Changelog
## 0.4.27

  - 18 changes: https://github.com/domokit/mojo/compare/5f0e8bf...9397aa5

  MOJO_SDK: 9397aa588d55e96077c3859d4a136e4e6adf57ea

## 0.4.26

  - 72 changes: https://github.com/domokit/mojo/compare/db036b1...38c5dbd

  MOJO_SDK: 38c5dbd1426e105d42d6b070b8e4089c9db957eb

## 0.4.25

  - 51 changes: https://github.com/domokit/mojo/compare/38edfe4...ee5b33c

  MOJO_SDK: ee5b33cba0face525d425d6bd8682e5de038ad73

## 0.4.24

  - 47 changes: https://github.com/domokit/mojo/compare/24614f9...ff47297

  MOJO_SDK: ff47297bfaed2660b106a67d6693343b0bc8356b

## 0.4.23

  - 28 changes: https://github.com/domokit/mojo/compare/107bac0...ef5cd66

  MOJO_SDK: ef5cd660ec6f1c50eaff62c81ea7662662d04e15

## 0.4.22

  - 22 changes: https://github.com/domokit/mojo/compare/12d71ee...f56fd59

  MOJO_SDK: f56fd59ec51e1ecdd52fb848ceff1b6b6fe7f7fa

## 0.4.21

  - 35 changes: https://github.com/domokit/mojo/compare/e95b5db...c200560

  MOJO_SDK: c200560ac45a79b61b8e8c0444af471789f5669f

## 0.4.20

  - 125 changes: https://github.com/domokit/mojo/compare/2f662f4...705723c

  MOJO_SDK: 705723c25a51b30a89b6431a6377b09e4069561e

## 0.4.19

  - 62 changes: https://github.com/domokit/mojo/compare/91e87dd...7c72e53

  MOJO_SDK: 7c72e53d105c346dd82cbdbeb12d9e3f0712093d

## 0.4.18

  - 103 changes: https://github.com/domokit/mojo/compare/f59d613...31c5037

  MOJO_SDK: 31c5037ab2c63649632c9f2d4227ebe6f22015a4

## 0.4.17

  - 48 changes: https://github.com/domokit/mojo/compare/2829804...1484e83

  MOJO_SDK: 1484e831758d05c7af0f27c199d24e3bbdc6383f

## 0.4.16

  - 80 changes: https://github.com/domokit/mojo/compare/9ec7563...1308cd1

  MOJO_SDK: 1308cd12434c9536a28592ff09399a57ef7f4f77

## 0.4.15

  - 17 changes: https://github.com/domokit/mojo/compare/f64c6d6...c9e1513

  MOJO_SDK: c9e15130499cc859050668ea6f78485001c96251

## 0.4.14

  - 41 changes: https://github.com/domokit/mojo/compare/ecb64e7...b3aaccc

  MOJO_SDK: b3aaccc8d9408bc645ee633e7030c605f333be95

## 0.4.13

  - 63 changes: https://github.com/domokit/mojo/compare/56bf5b4...2ae2bcc

  MOJO_SDK: 2ae2bccb82f37947c69ab5d6e06c2d109690a394

## 0.4.12

  - 25 changes: https://github.com/domokit/mojo/compare/1d94b2f...ebf4352

  MOJO_SDK: ebf435275996a69482ea342aa3ae881aecd6c90e

## 0.4.11

  - 52 changes: https://github.com/domokit/mojo/compare/c6806ae...3f50c60

  MOJO_SDK: 3f50c60f8af5bb485f248ceea2407a59f09caad5

## 0.4.10

  - 55 changes: https://github.com/domokit/mojo/compare/e50fde8...bb76300

## 0.4.9

  - 65 changes: https://github.com/domokit/mojo/compare/d0070e0...b56047c

## 0.4.8

  - 16 changes: https://github.com/domokit/mojo/compare/a05a1a6...e93037e

## 0.4.7

  - 45 changes: https://github.com/domokit/mojo/compare/1bf8c18...5fb6ad9

## 0.4.6

  - 63 changes: https://github.com/domokit/mojo/compare/3ab01fc...3d67098

## 0.4.5

  - 11 changes: https://github.com/domokit/mojo/compare/0f44252...2ccd493

## 0.4.4

  - 62 changes: https://github.com/domokit/mojo/compare/1a0ec50...3616f6d

## 0.4.3

  - 5 changes: https://github.com/domokit/mojo/compare/fb583de...e4ac236

## 0.4.2

  - 3 changes: https://github.com/domokit/mojo/compare/4267a7d...b65b17a

## 0.4.1

  - 0 changes: https://github.com/domokit/mojo/compare/70dca39...70dca39

## 0.3.2

  - 62 changes: https://github.com/domokit/mojo/compare/b917a90...3230048

## 0.3.1

  - 64 changes: https://github.com/domokit/mojo/compare/e590bb1...241ff8a

## 0.3.0

  - 17 changes: https://github.com/domokit/mojo/compare/8a9c751...63df3b7

## 0.2.1

  - 79 changes: https://github.com/domokit/mojo/compare/2fa0b55...0ea08b0

## 0.2.0

  - 92 changes: https://github.com/domokit/mojo/compare/c1d7bc9...0894421

## 0.1.0

  - 0 changes: https://github.com/domokit/mojo/compare/86d3dc4...86d3dc4

## 0.0.25

  - 166 changes: https://github.com/domokit/mojo/compare/5fa852b...3139c74

## 0.0.23

## 0.0.22

  - 58 changes: https://github.com/domokit/mojo/compare/e172885...35de44e

## 0.0.18

  - 89 changes: https://github.com/domokit/mojo/compare/0fd4d06...c3119f6

## 0.0.17

  - 18 changes: https://github.com/domokit/mojo/compare/e7433cf...8879bfd

## 0.0.16

  - 27 changes: https://github.com/domokit/mojo/compare/e028733...e7433cf

## 0.0.15

  - 6 changes: https://github.com/domokit/mojo/compare/4df2d39...e028733

## 0.0.14

  - 138 changes: https://github.com/domokit/mojo/compare/850ac24...cf84c48

## 0.0.13

  - 70 changes: https://github.com/domokit/mojo/compare/889091e...136e0d4

## 0.0.12

  - 29 changes: https://github.com/domokit/mojo/compare/e25e3e2...432ce45

## 0.0.11

  - 197 changes: https://github.com/domokit/mojo/compare/bdbb0c7...fb1b726

## 0.0.10

  - 23 changes: https://github.com/domokit/mojo/compare/1b7bcee...be9dad7

## 0.0.8

  - Update version to match sky package.  0.0.7 was skipped.

## 0.0.6

  - Fix interface name capitalization bug in Dart bindings
  - Add support for interface control messages (queryVersion, requireVersion)







 
