Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
cd52372
Initial support for DDC + FES with build_runner
Markzipan Aug 28, 2025
af089bf
Adding hot reload flag consistency checks and enforcing module builde…
Markzipan Aug 29, 2025
01e2411
Moving sources to generated scratch dirs
Markzipan Sep 4, 2025
414fc95
Merging
Markzipan Sep 4, 2025
fa6594f
Only recompiling and invalidating requested source files
Markzipan Sep 5, 2025
09a0486
Merge branch 'master' of github.com:dart-lang/build
Markzipan Sep 17, 2025
efec641
Sample change with a hacky shared repo + digests impl comparisons
Markzipan Sep 23, 2025
aae24a2
Moving shared state to scratch space
Markzipan Sep 26, 2025
7aba038
Merging
Markzipan Sep 29, 2025
51f1e0d
addressing analysis errors
Markzipan Sep 29, 2025
5d309ca
additional file cleanup
Markzipan Sep 29, 2025
9a37369
Adding build_modules tests
Markzipan Sep 29, 2025
b2bab91
Adding build_modules tests
Markzipan Sep 29, 2025
cba3f6b
Merging
Markzipan Sep 30, 2025
244dcd4
Merge branch 'master' of github.com:dart-lang/build
Markzipan Sep 30, 2025
12a8af7
Adding reset to frontend server driver
Markzipan Oct 1, 2025
b9e30b3
Adding a builder for labeling the app entrypoint.
Markzipan Oct 1, 2025
309b11f
Removing the entrypoint from builder options
Markzipan Oct 1, 2025
625a922
Fixing error handling
Markzipan Oct 1, 2025
150a42a
Fixing some shutdown race conditions
Markzipan Oct 3, 2025
c48e015
Adding reader-writer resets
Markzipan Oct 3, 2025
9349807
Adding support for incremental build testing.
Markzipan Oct 3, 2025
f108cb6
Adding DDC frontend server builder tests
Markzipan Oct 3, 2025
75f3061
Updating entrypoint marker builder
Markzipan Oct 3, 2025
e248938
Merge branch 'master' of github.com:dart-lang/build
Markzipan Oct 3, 2025
020956a
Moving ddc fes build_web_compilers tests to web_compilers_test.dart
Markzipan Oct 24, 2025
3ceb26f
Updating scratch_space version and deps
Markzipan Oct 24, 2025
fb5c7ee
Merge remote-tracking branch 'refs/remotes/origin/master'
Markzipan Oct 24, 2025
b235dcd
creating a frontend server specific resource for holding state + bump…
Markzipan Oct 24, 2025
d914dfc
Adding flag to entrypoint market to avoid extraneous work
Markzipan Oct 27, 2025
eeebe86
extending timeout for daemon test
Markzipan Oct 27, 2025
0b61746
adding builder options check
Markzipan Oct 27, 2025
2ebfc54
fixing bootstrap tests
Markzipan Oct 27, 2025
0ca833b
reverting unused readerwriter updates
Markzipan Oct 27, 2025
6fe34d3
bumping versions
Markzipan Oct 27, 2025
2635ce3
Updating changelog and bumping versions
Markzipan Oct 27, 2025
ca4156c
Merging
Markzipan Oct 27, 2025
f61ce53
fixing ver nums
Markzipan Oct 27, 2025
c0e5596
Merging
Markzipan Oct 29, 2025
a33fb47
Merging
Markzipan Oct 29, 2025
9c1f804
removing unused classes and methods
Markzipan Oct 29, 2025
127dcfe
restructuring fes errors
Markzipan Oct 29, 2025
0326968
updating comments
Markzipan Oct 29, 2025
7c38d66
adding todo;
Markzipan Oct 29, 2025
b3e43c2
bumping timeout
Markzipan Oct 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion build_modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
## 5.1.0

- Add drivers and state resources required for DDC + Frontend Server compilation.
- Add an option to disable strongly connected components for determining module boundaries.

## 5.0.18

- Remove unused dev depencency: `build_runner_core`.
- Remove unused dev dependency: `build_runner_core`.
- Allow Dart SDK 3.10.x and 3.11 prerelease.

## 5.0.17
Expand Down
14 changes: 11 additions & 3 deletions build_modules/lib/build_modules.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,25 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

export 'src/ddc_names.dart';
export 'src/errors.dart' show MissingModulesException, UnsupportedModules;
export 'src/kernel_builder.dart'
show KernelBuilder, multiRootScheme, reportUnusedKernelInputs;
export 'src/frontend_server_resources.dart'
show frontendServerState, frontendServerStateResource;
export 'src/kernel_builder.dart' show KernelBuilder, reportUnusedKernelInputs;
export 'src/meta_module_builder.dart'
show MetaModuleBuilder, metaModuleExtension;
export 'src/meta_module_clean_builder.dart'
show MetaModuleCleanBuilder, metaModuleCleanExtension;
export 'src/module_builder.dart' show ModuleBuilder, moduleExtension;
export 'src/module_library.dart' show ModuleLibrary;
export 'src/module_library_builder.dart'
show ModuleLibraryBuilder, moduleLibraryExtension;
export 'src/modules.dart';
export 'src/platform.dart' show DartPlatform;
export 'src/scratch_space.dart' show scratchSpace, scratchSpaceResource;
export 'src/workers.dart' show dartdevkDriverResource, maxWorkersPerTask;
export 'src/workers.dart'
show
dartdevkDriverResource,
frontendServerProxyDriverResource,
maxWorkersPerTask,
persistentFrontendServerResource;
14 changes: 14 additions & 0 deletions build_modules/lib/src/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,17 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'dart:io';

import 'package:build/build.dart';
import 'package:path/path.dart' as p;
import 'package:scratch_space/scratch_space.dart';

const multiRootScheme = 'org-dartlang-app';
const webHotReloadOption = 'web-hot-reload';
final sdkDir = p.dirname(p.dirname(Platform.resolvedExecutable));
final packagesFilePath = p.join('.dart_tool', 'package_config.json');

final defaultAnalysisOptionsId = AssetId(
'build_modules',
'lib/src/analysis_options.default.yaml',
Expand All @@ -16,6 +24,12 @@ String defaultAnalysisOptionsArg(ScratchSpace scratchSpace) =>
enum ModuleStrategy { fine, coarse }

ModuleStrategy moduleStrategy(BuilderOptions options) {
// DDC's Library Bundle module system only supports fine modules since it must
// align with the Frontend Server's library management scheme.
final usesWebHotReload = options.config[webHotReloadOption] as bool? ?? false;
if (usesWebHotReload) {
return ModuleStrategy.fine;
}
final config = options.config['strategy'] as String? ?? 'coarse';
switch (config) {
case 'coarse':
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
// Copyright (c) 2018, the Dart project authors. Please see the AUTHORS file
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:path/path.dart' as p;

/// Logic in this file must be synchronized with their namesakes in DDC at:
/// pkg/dev_compiler/lib/src/compiler/js_names.dart

/// Transforms a path to a valid JS identifier.
///
/// This logic must be synchronized with [pathToJSIdentifier] in DDC at:
/// pkg/dev_compiler/lib/src/compiler/module_builder.dart
///
/// For backwards compatibility, if this pattern is changed,
/// dev_compiler_bootstrap.dart must be updated to accept both old and new
/// patterns.
Expand All @@ -35,12 +35,11 @@ String toJSIdentifier(String name) {
for (var i = 0; i < name.length; i++) {
final ch = name[i];
final needsEscape = ch == r'$' || _invalidCharInIdentifier.hasMatch(ch);
if (needsEscape && buffer == null) {
buffer = StringBuffer(name.substring(0, i));
}
if (buffer != null) {
buffer.write(needsEscape ? '\$${ch.codeUnits.join("")}' : ch);
if (needsEscape) {
buffer ??= StringBuffer(name.substring(0, i));
}

buffer?.write(needsEscape ? '\$${ch.codeUnits.join("")}' : ch);
}

final result = buffer != null ? '$buffer' : name;
Expand All @@ -56,7 +55,11 @@ String toJSIdentifier(String name) {
/// Also handles invalid variable names in strict mode, like "arguments".
bool invalidVariableName(String keyword, {bool strictMode = true}) {
switch (keyword) {
// http://www.ecma-international.org/ecma-262/6.0/#sec-future-reserved-words
// https://262.ecma-international.org/6.0/#sec-reserved-words
case 'true':
case 'false':
case 'null':
// https://262.ecma-international.org/6.0/#sec-keywords
case 'await':
case 'break':
case 'case':
Expand All @@ -79,7 +82,6 @@ bool invalidVariableName(String keyword, {bool strictMode = true}) {
case 'import':
case 'in':
case 'instanceof':
case 'let':
case 'new':
case 'return':
case 'super':
Expand All @@ -99,6 +101,7 @@ bool invalidVariableName(String keyword, {bool strictMode = true}) {
// http://www.ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors
case 'implements':
case 'interface':
case 'let':
case 'package':
case 'private':
case 'protected':
Expand Down
Loading
Loading