Skip to content

Commit cd15f91

Browse files
committed
Merge branch 'main' into patch-1
2 parents 3179e76 + 1bd6a55 commit cd15f91

File tree

293 files changed

+16244
-9229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

293 files changed

+16244
-9229
lines changed

.github/workflows/codeql-analysis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ jobs:
2929

3030
steps:
3131
- name: Checkout repository
32-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
32+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
3333

3434
# Initializes the CodeQL tools for scanning.
3535
- name: Initialize CodeQL
36-
uses: github/codeql-action/init@05963f47d870e2cb19a537396c1f668a348c7d8f
36+
uses: github/codeql-action/init@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
3737
with:
3838
languages: ${{ matrix.language }}
3939
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -44,7 +44,7 @@ jobs:
4444
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
4545
# If this step fails, then you should remove it and run the build manually (see below)
4646
- name: Autobuild
47-
uses: github/codeql-action/autobuild@05963f47d870e2cb19a537396c1f668a348c7d8f
47+
uses: github/codeql-action/autobuild@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
4848

4949
# ℹ️ Command-line programs to run using the OS shell.
5050
# 📚 https://git.io/JvXDl
@@ -58,4 +58,4 @@ jobs:
5858
# make release
5959

6060
- name: Perform CodeQL Analysis
61-
uses: github/codeql-action/analyze@05963f47d870e2cb19a537396c1f668a348c7d8f
61+
uses: github/codeql-action/analyze@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a

.github/workflows/scorecards-analysis.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ jobs:
2121

2222
steps:
2323
- name: "Checkout code"
24-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
24+
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
2525
with:
2626
persist-credentials: false
2727

2828
- name: "Run analysis"
29-
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736
29+
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46
3030
with:
3131
results_file: results.sarif
3232
results_format: sarif
@@ -41,14 +41,14 @@ jobs:
4141

4242
# Upload the results as artifacts (optional).
4343
- name: "Upload artifact"
44-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3
44+
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b
4545
with:
4646
name: SARIF file
4747
path: results.sarif
4848
retention-days: 5
4949

5050
# Upload the results to GitHub's code scanning dashboard.
5151
- name: "Upload to code-scanning"
52-
uses: github/codeql-action/upload-sarif@05963f47d870e2cb19a537396c1f668a348c7d8f
52+
uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a
5353
with:
5454
sarif_file: results.sarif

.github/workflows/test.yml

+26-13
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
experimental: false
3838
continue-on-error: ${{ matrix.experimental }}
3939
steps:
40-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
40+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
4141
with:
4242
submodules: recursive
43-
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
43+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
4444
with:
4545
sdk: ${{ matrix.sdk }}
4646
- name: Fetch Dart packages
@@ -56,33 +56,31 @@ jobs:
5656
name: Check if code excerpts are up to date
5757
runs-on: ubuntu-latest
5858
steps:
59-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
59+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
6060
with:
6161
submodules: recursive
62-
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
62+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
6363
with:
6464
sdk: stable
6565
- name: Fetch Dart packages
6666
run: dart pub get
6767
- name: Check if excerpts are up to date
68-
run: dart run dart_site refresh-excerpts --fail-on-update
68+
run: dart run dart_site refresh-excerpts --fail-on-update --dry-run
6969

7070
linkcheck:
7171
name: Build site and check links
7272
runs-on: ubuntu-latest
7373
steps:
74-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
74+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
7575
with:
7676
submodules: recursive
77-
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
77+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
7878
with:
7979
sdk: stable
8080
- name: Fetch Dart packages
8181
run: dart pub get
82-
- uses: pnpm/action-setup@a3252b78c470c02df07e9d59298aecedc3ccdd6d
83-
with:
84-
version: 8
85-
- uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8
82+
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
83+
- uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b
8684
with:
8785
node-version: ${{ env.NODE_VERSION }}
8886
cache: 'pnpm'
@@ -95,14 +93,29 @@ jobs:
9593
- name: Check internal site links are functional
9694
run: dart run dart_site check-links
9795

96+
site-variable-scanner:
97+
name: Check if text can be replaced with site variables
98+
runs-on: ubuntu-latest
99+
steps:
100+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
101+
with:
102+
submodules: recursive
103+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
104+
with:
105+
sdk: stable
106+
- name: Fetch Dart packages
107+
run: dart pub get
108+
- name: Check if text can be replaced with site variables
109+
run: dart run dart_site check-site-variable
110+
98111
firebase-validate:
99112
name: Validate Firebase configuration
100113
runs-on: ubuntu-latest
101114
steps:
102-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11
115+
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
103116
with:
104117
submodules: recursive
105-
- uses: dart-lang/setup-dart@fedb1266e91cf51be2fdb382869461a434b920a3
118+
- uses: dart-lang/setup-dart@0a8a0fc875eb934c15d08629302413c671d3f672
106119
with:
107120
sdk: stable
108121
- name: Fetch Dart packages

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
_cache/
22
_site/
3+
.cache
34
.*-cache
45
.*-metadata
56
.buildlog

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ Michael Haubenwallner <michael.haubenwallner@gmail.com>
1414
Victor Berchet <victor.berchet@gmail.com>
1515
Pradumna Saraf <pradumnasaraf@gmail.com>
1616
Parker Lougheed <parlough@gmail.com>
17+
Amos Hu <amoshuke@gmail.com>

README.md

+18-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ If you prefer, you can use a version manager such as [nvm][],
6969
and run `nvm install` from the repository's root directory.
7070

7171
If you already have Node installed, verify it's available on your path
72-
and already the latest stable version _(currently `20.10` or later)_:
72+
and already the latest stable version _(currently `20.12` or later)_:
7373

7474
```terminal
7575
node --version
@@ -226,6 +226,23 @@ on the [Flutter contributors Discord][]!
226226

227227
[Flutter contributors Discord]: https://github.com/flutter/flutter/wiki/Chat
228228

229+
### Refresh code excerpts
230+
231+
A build that fails with the error
232+
`Error: Some code excerpts needed to be updated!`
233+
means that one or more code excerpts in the site Markdown files
234+
aren't identical to the code regions declared
235+
in the corresponding `.dart` files.
236+
237+
To resolve this error,
238+
from the root of the `site-www` directory,
239+
run `./dash_site refresh-excerpts`.
240+
241+
To learn more about creating, editing, and using code excerpts,
242+
check out the [excerpt updater package documentation][].
243+
244+
[excerpt updater package documentation]: https://github.com/dart-lang/site-shared/tree/main/packages/excerpter#readme
245+
229246
## [Optional] Deploy to a staging site
230247

231248
Submitted pull requests can be automatically staged

build.excerpt.yaml

-15
This file was deleted.

dash_site

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#!/bin/bash
22

3-
REQUIRED_DART_VERSION="3.3"
4-
REQUIRED_NODE_VERSION="20.10"
5-
REQUIRED_PNPM_VERSION="8.14"
3+
REQUIRED_DART_VERSION="3.4"
4+
REQUIRED_NODE_VERSION="20.12"
5+
REQUIRED_PNPM_VERSION="9.1"
66

77
# Check that the 'dart' command is available on the user's path.
88
if ! command -v dart &> /dev/null; then

eleventy.config.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ import * as sass from 'sass';
2727
*/
2828
export default function (eleventyConfig) {
2929
const isProduction = process.env.PRODUCTION === 'true';
30+
const shouldOptimize = process.env.OPTIMIZE === 'true';
3031

3132
eleventyConfig.on('eleventy.before', async () => {
3233
await configureHighlighting(markdown);
@@ -71,7 +72,7 @@ export default function (eleventyConfig) {
7172
}
7273

7374
const result = sass.compileString(inputContent, {
74-
style: isProduction ? 'compressed' : 'expanded',
75+
style: shouldOptimize ? 'compressed' : 'expanded',
7576
quietDeps: true,
7677
loadPaths: [parsedPath.dir, 'src/_sass'],
7778
});
@@ -101,7 +102,7 @@ export default function (eleventyConfig) {
101102
'src/content/guides/language/specifications',
102103
);
103104

104-
if (isProduction) {
105+
if (shouldOptimize) {
105106
// If building for production, minify/optimize the HTML output.
106107
// Doing so during serving isn't worth the extra build time.
107108
eleventyConfig.addTransform('minify-html', async function (content) {

examples/analysis/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: examples
22
description: dart.dev example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dependencies:
88
examples_util: {path: ../util}
99

1010
dev_dependencies:
11-
lints: ^3.0.0
11+
lints: ^4.0.0

examples/analysis_alt/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: examples
22
description: dart.dev example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dev_dependencies:
8-
lints: ^3.0.0
8+
lints: ^4.0.0
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
// #docregion ''
1+
// #docregion no-error
22
Future<void> fetchUserOrder() {
33
// Imagine that this function is fetching user info from another service or database.
44
return Future.delayed(const Duration(seconds: 2), () => print('Large Latte'));
55
}
6-
// #enddocregion ''
6+
// #enddocregion no-error
77

88
// #docregion error
99
Future<void> fetchUserOrderError() {
@@ -13,10 +13,10 @@ Future<void> fetchUserOrderError() {
1313
() => throw Exception('Logout failed: user ID is invalid'),
1414
);
1515
}
16-
// #docregion ''
16+
// #docregion no-error
1717

1818
void main() {
1919
fetchUserOrder();
2020
print('Fetching user order...');
2121
}
22-
// #enddocregion error
22+
// #enddocregion no-error, error

examples/async_await/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: async_await
22
description: dart.dev example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dependencies:
88
examples_util: {path: ../util}
99

1010
dev_dependencies:
11-
lints: ^3.0.0
11+
lints: ^4.0.0
1212
test: ^1.25.2

examples/build_runner_usage/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: build_runner_usage
22
description: dart.dev build_runner example code.
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dev_dependencies:
88
args: ^2.4.0
99
build_runner: ^2.4.8
1010
build_test: ^2.2.2
11-
lints: ^3.0.0
11+
lints: ^4.0.0

examples/cli/pubspec.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: cli_examples
22
description: Examples for CLI tutorials on dart.dev
33

44
environment:
5-
sdk: ^3.3.0
5+
sdk: ^3.4.0
66

77
dependencies:
88
args: ^2.4.2
99

1010
dev_dependencies:
11-
lints: ^3.0.0
11+
lints: ^4.0.0
1212
test: ^1.25.2

examples/concurrency/lib/async_number_of_keys.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import 'dart:convert';
22
import 'dart:io';
33

4-
// #docregion
4+
// #docregion non-blocking
55
const String filename = 'with_keys.json';
66

77
void main() async {
@@ -18,4 +18,4 @@ Future<String> _readFileAsync() async {
1818
final contents = await file.readAsString();
1919
return contents.trim();
2020
}
21-
// #enddocregion
21+
// #enddocregion non-blocking

examples/concurrency/lib/basic_ports_example/start.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ignore_for_file: unused_field, unused_element
22
import 'dart:isolate';
33

4-
// #docregion
4+
// #docregion worker
55
class Worker {
66
Future<void> spawn() async {
77
// TODO: Add functionality to spawn a worker isolate.
@@ -20,4 +20,4 @@ class Worker {
2020
// be used to send messages to the worker isolate.
2121
}
2222
}
23-
// #enddocregion
23+
// #enddocregion worker
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// ignore_for_file: unused_element
22
import 'dart:io';
33

4-
// #docregion
4+
// #docregion read-async
55
Future<String> _readFileAsync(String filename) {
66
final file = File(filename);
77

@@ -11,4 +11,4 @@ Future<String> _readFileAsync(String filename) {
1111
return contents.trim();
1212
});
1313
}
14-
// #enddocregion
14+
// #enddocregion read-async
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import 'dart:isolate';
22

3-
// #docregion
3+
// #docregion slow
44
int slowFib(int n) => n <= 1 ? 1 : slowFib(n - 1) + slowFib(n - 2);
55

66
// Compute without blocking current isolate.
77
void fib40() async {
88
var result = await Isolate.run(() => slowFib(40));
99
print('Fib(40) = $result');
1010
}
11-
// #enddocregion
11+
// #enddocregion slow

0 commit comments

Comments
 (0)