build_web_compilers 0.2.1+1

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 48

build_web_compilers #

Web compilers for users of package:build.
Build Status Issues related to build_web_compilers Pub Package Version Latest Dartdocs Join the chat on Gitter

Installation #

This package is intended to be used as a development dependency for users of package:build who want to run code in a browser. Simply add the following to your pubspec.yaml:

dev_dependencies:
  build_web_compilers:

Usage #

If you are using the autogenerated build script (going through pub run build_runner <command> instead of handwriting a build.dart file), then all you need is the dev_dependency listed above.

Configuration #

By default, the dartdevc compiler will be used, which is the Dart Development Compiler.

If you would like to opt into dart2js you will need to add a build.yaml file, which should look roughly like the following:

targets:
  $default
    builders:
      build_web_compilers|entrypoint:
        # These are globs for the entrypoints you want to compile.
        generate_for:
        - test/**.browser_test.dart
        - web/**.dart
        options:
          compiler: dart2js
          # List any dart2js specific args here, or omit it.
          dart2js_args:
          - --checked

We are working on command line configuration as well, you can follow https://github.com/dart-lang/build/issues/801 for updates on that.

Manual Usage #

If you are using a custom build script, you will need to add the following builder applications to what you already have, almost certainly at the end of the list (unless you need to post-process the js files).

[
    apply(
        'build_web_compilers|ddc',
        [
        (_) => new ModuleBuilder(),
        (_) => new UnlinkedSummaryBuilder(),
        (_) => new LinkedSummaryBuilder(),
        (_) => new DevCompilerBuilder()
        ],
        toAllPackages(),
        // Recommended, but not required. This makes it so only modules that are
        // imported by entrypoints get compiled.
        isOptional: true,
        hideOutput: true),
    apply('build_web_compilers|entrypoint',
        // You can also use `WebCompiler.Dart2Js`. If you don't care about
        // dartdevc at all you may also omit the previous builder application
        // entirely.
        [(_) => new WebEntrypointBuilder(WebCompiler.DartDevc)], toRoot(),
        hideOutput: true,
        // These globs should match your entrypoints only.
        defaultGenerateFor: const InputSet(
            include: const ['web/**', 'test/**.browser_test.dart'])),
]

0.2.1+1 #

  • Support the latest analyzer package.

0.2.1 #

  • All dart files under test are now compiled by default instead of only the _browser_test.dart files (minus vm/node test bootstrap files). This means the original tests can be debugged directly (prior to package:test bootstrapping).
  • Updated to package:build version 0.12.0.

0.2.0 #

New Features #

  • Added support for dart2js. This can be configured using the top level compiler option for the build_web_compilers|entrypoint builder. The supported options are dartdevc (the default) and dart2js. Args can be passed to dart2js using the dart2js_args option. For example:
targets:
  <my_package>:
    builders:
      build_web_compilers|entrypoint:
        options:
          compiler: dart2js
          dart2js_args:
          - --minify

Breaking Changes #

  • Renamed ddc_bootstrap builder to entrypoint, the exposed class also changed from DevCompilerBootstrapBuilder to WebEntrypointBuilder.
  • Renamed jsBootstrapExtension to ddcBootstrapExtension since it is only required when using the dev compiler.

0.1.1 #

  • Mark ddc_bootstrap builder with build_to: cache.
  • Publish as build_web_compilers

0.1.0 #

  • Add builder factories.
  • Fixed temp dir cleanup bug on windows.
  • Enabled support for running tests in --precompiled mode.

0.0.1 #

  • Initial release with support for building analyzer summaries and DDC modules.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  build_web_compilers: ^0.2.1+1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:build_web_compilers/build_web_compilers.dart';
  
Version Uploaded Documentation Archive
2.0.2 May 22, 2019 Go to the documentation of build_web_compilers 2.0.2 Download build_web_compilers 2.0.2 archive
2.0.1 May 21, 2019 Go to the documentation of build_web_compilers 2.0.1 Download build_web_compilers 2.0.1 archive
2.0.0 Apr 24, 2019 Go to the documentation of build_web_compilers 2.0.0 Download build_web_compilers 2.0.0 archive
1.2.1 Apr 17, 2019 Go to the documentation of build_web_compilers 1.2.1 Download build_web_compilers 1.2.1 archive
1.2.0 Mar 14, 2019 Go to the documentation of build_web_compilers 1.2.0 Download build_web_compilers 1.2.0 archive
1.1.0 Feb 1, 2019 Go to the documentation of build_web_compilers 1.1.0 Download build_web_compilers 1.1.0 archive
1.0.2 Feb 1, 2019 Go to the documentation of build_web_compilers 1.0.2 Download build_web_compilers 1.0.2 archive
1.0.1 Jan 31, 2019 Go to the documentation of build_web_compilers 1.0.1 Download build_web_compilers 1.0.1 archive
1.0.0 Dec 10, 2018 Go to the documentation of build_web_compilers 1.0.0 Download build_web_compilers 1.0.0 archive
0.4.4+3 Dec 5, 2018 Go to the documentation of build_web_compilers 0.4.4+3 Download build_web_compilers 0.4.4+3 archive

All 44 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
96
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.22.1 <2.0.0