Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Copyright 2025 The Flutter Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
-->
This is draft for future release notes, that are going to land on
This is a draft for future release notes that are going to land on
[the Flutter website](https://docs.flutter.dev/tools/devtools/release-notes).

# DevTools 2.55.0 release notes

The 2.55.0 release of the Dart and Flutter DevTools
includes the following changes among other general improvements.
To learn more about DevTools, check out the
[DevTools overview](/tools/devtools/overview).
[DevTools overview](/tools/devtools).

## General updates

Expand Down Expand Up @@ -53,11 +53,11 @@ TODO: Remove this section if there are not any updates.

TODO: Remove this section if there are not any updates.

## VS Code Sidebar updates
## VS Code sidebar updates

TODO: Remove this section if there are not any updates.

## DevTools Extension updates
## DevTools extension updates

TODO: Remove this section if there are not any updates.

Expand Down
21 changes: 13 additions & 8 deletions packages/devtools_app/release_notes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,21 @@ found in the LICENSE file or at https://developers.google.com/open-source/licens
When you add a user-facing change to DevTools,
please add a release note entry to document this improvement.

This entry should be phrased in the past tense (e.g. "Added XYZ" instead of "Add XYZ").
This entry should be phrased in the past tense.
For example, "Added XYZ" instead of "Add XYZ".

### Release note entry

Use this format for the entry:

```markdown
* Created the best feature ever. -
[#10000000001](https://github.com/flutter/devtools/pull/10000000001),
[#10000000002](https://github.com/flutter/devtools/pull/10000000002),
[#10000000003](https://github.com/flutter/devtools/pull/10000000003)
[#10000000001](https://github.com/flutter/devtools/pull/10000000001),
[#10000000002](https://github.com/flutter/devtools/pull/10000000002),
[#10000000003](https://github.com/flutter/devtools/pull/10000000003)
```

Find other examples in [previous notes](https://github.com/flutter/website/tree/main/src/tools/devtools/release-notes).
Find other examples in [previous notes](https://github.com/flutter/website/tree/main/src/content/tools/devtools/release-notes).

### Adding images to a release note entry

Expand All @@ -37,10 +38,12 @@ Consider adding an image to the release note entry:
```

#### Image style
Please use DevTools in **dark mode** when taking screenshots for release
notes. We use a dark theme since this is the default theme for DevTools.

Please use DevTools in **dark mode** when taking screenshots for release notes.
We use a dark theme since this is the default theme for DevTools.

#### Image size

When adding images, be cognizant that the images will be rendered in a
relatively small window in DevTools, and they should be sized accordingly.
A wide aspect ratio is preferred so that the space of the release notes
Expand All @@ -58,7 +61,9 @@ Before continuing, ensure you have your local environment set up for

### Creating the release notes PR

Draft release notes on a local `flutter/website` branch using the following command:
Draft release notes on a local `flutter/website` branch by running
the following command with the path to your local `flutter/website` repo:

```console
dt release-notes -w /Users/me/absolute/path/to/flutter/website
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ Copyright 2025 The Flutter Authors
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.
-->
This is draft for future release notes, that are going to land on
This is a draft for future release notes that are going to land on
[the Flutter website](https://docs.flutter.dev/tools/devtools/release-notes).

# DevTools <number> release notes

The <number> release of the Dart and Flutter DevTools
includes the following changes among other general improvements.
To learn more about DevTools, check out the
[DevTools overview](/tools/devtools/overview).
[DevTools overview](/tools/devtools).

## General updates

Expand Down Expand Up @@ -53,11 +53,11 @@ TODO: Remove this section if there are not any updates.

TODO: Remove this section if there are not any updates.

## VS Code Sidebar updates
## VS Code sidebar updates

TODO: Remove this section if there are not any updates.

## DevTools Extension updates
## DevTools extension updates

TODO: Remove this section if there are not any updates.

Expand Down
48 changes: 32 additions & 16 deletions tool/lib/commands/release_notes_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ class ReleaseNotesCommand extends Command {
CliCommand.git(['stash']),
CliCommand.git(['checkout', 'main']),
CliCommand.git(['pull']),
CliCommand.git(['submodule', 'update', '--init', '--recursive']),
CliCommand.git([
'checkout',
'-b',
Expand Down Expand Up @@ -114,7 +113,7 @@ class ReleaseNotesCommand extends Command {
),
)..createSync();

final srcLines = devToolsReleaseNotes.srcLines;
final srcLines = devToolsReleaseNotes.sourceLines;

// Copy release notes images and fix image reference paths.
if (devToolsReleaseNotes.imageLineIndices.isNotEmpty) {
Expand Down Expand Up @@ -142,19 +141,19 @@ class ReleaseNotesCommand extends Command {
}
}

final metadataHeader = '''---
releaseNotesMd.writeAsStringSync('''---
title: DevTools $releaseNotesVersion release notes
shortTitle: $releaseNotesVersion release notes
breadcrumb: $releaseNotesVersion
showToc: false
---

''';
''');

// Write the 'release-notes-<x.y.z>.md' file, including any updates for
// image paths.
// Write the contents of the 'release-notes-<x.y.z>.md' file,
// including any updates for image paths.
releaseNotesMd.writeAsStringSync(
metadataHeader + srcLines.joinWithNewLine(),
srcLines.joinWithNewLine().trimLeft(),
flush: true,
);

Expand All @@ -178,7 +177,7 @@ class _DevToolsReleaseNotes {
_DevToolsReleaseNotes._({
required this.file,
required this.version,
required this.srcLines,
required this.sourceLines,
required this.imageLineIndices,
});

Expand All @@ -192,8 +191,8 @@ class _DevToolsReleaseNotes {

final rawLines = file.readAsLinesSync();

late String version;
late int titleLineIndex;
String? version;
int? sourceStartIndex;
final versionRegExp = RegExp(r"\d+\.\d+\.\d+");
for (int i = 0; i < rawLines.length; i++) {
final line = rawLines[i];
Expand All @@ -202,17 +201,34 @@ class _DevToolsReleaseNotes {
// This match should be from the line "# DevTools <x.y.z> release notes".
version = matches.first.group(0)!;
// This is the markdown title where the release notes src begins.
titleLineIndex = i;
sourceStartIndex = i + 1;
break;
}

if (version == null || sourceStartIndex == null) {
throw Exception(
'Could not find the title line ("# DevTools x.y.z release notes") '
'in the NEXT_RELEASE_NOTES.md file.',
);
}

if (sourceStartIndex >= rawLines.length) {
throw Exception(
'No content found after the title line ("# DevTools x.y.z release notes") '
'in the NEXT_RELEASE_NOTES.md file.',
);
}

// Don't include the copyright, draft notice, or h1 header in
// the output release notes.
final sourceLines = rawLines.sublist(sourceStartIndex);

// TODO(kenz): one nice polish task could be to remove sections that are
// empty (i.e. sections that have the line
// "TODO: Remove this section if there are not any updates.").
final srcLines = rawLines.sublist(titleLineIndex);
final imageLineIndices = <int>{};
for (int i = 0; i < srcLines.length; i++) {
final line = srcLines[i];
for (int i = 0; i < sourceLines.length; i++) {
final line = sourceLines[i];
if (line.contains(_imagePathMarker)) {
imageLineIndices.add(i);
}
Expand All @@ -221,14 +237,14 @@ class _DevToolsReleaseNotes {
return _DevToolsReleaseNotes._(
file: file,
version: version,
srcLines: srcLines,
sourceLines: sourceLines,
imageLineIndices: imageLineIndices,
);
}

final File file;
final String version;
final List<String> srcLines;
final List<String> sourceLines;
final Set<int> imageLineIndices;

static final _imagePathMarker = RegExp(r'images\/.*\.png');
Expand Down
Loading