Skip to content

Conversation

@dcharkes
Copy link
Collaborator

@dcharkes dcharkes commented Dec 18, 2025

This PR:

  • Introduces a bunch of test data. Partially copied from the Dart SDK expect files, partially handwritten.
  • Introduces a JSON schema for the record use files.
  • Removes the handwritten JSON parsing/unparsing and introduces a generated syntax.
  • Extends the JSON syntax generator to cover some new types.
    (Such as List<int?> where the nullability comes from the type in the JSON schema being defined as a ["integer", "null"] rather than "integer" and the field in the dictionary being non-required.)

Bug: #2681

This PR does not:

  • Change the JSON format.
    • The current format does not support certain consts.
    • Has inconsistencies with casing
    • And mixes class definitions and method definitions together leading to fields that are nullable in places where they shouldn't.
      I have filed issues in [record_use] Correctness: ☂️ JSON format #1093.
  • Author the public API surface. (The JSON methods on the individual classes do not need to be part of the public API.)

@github-actions
Copy link

github-actions bot commented Dec 18, 2025

PR Health

License Headers ✔️
// 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.
Files
no missing headers

All source files should start with a license header.

Unrelated files missing license headers
Files
pkgs/hooks_runner/test_data/download_assets/hook/build.dart
pkgs/jni/test/debug_release_test.dart
pkgs/objective_c/example/command_line/lib/main.dart
pkgs/objective_c/lib/src/ns_input_stream.dart

This check can be disabled by tagging the PR with skip-license-check.

API leaks ✔️

The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.

Package Leaked API symbol Leaking sources

This check can be disabled by tagging the PR with skip-leaking-check.

Breaking changes ✔️
Package Change Current Version New Version Needed Version Looking good?
hooks None 1.0.0 1.0.0 1.0.0 ✔️
record_use Breaking 0.4.2 0.5.0-wip 0.5.0 ✔️

This check can be disabled by tagging the PR with skip-breaking-check.

Changelog Entry ✔️
Package Changed Files

Changes to files need to be accounted for in their respective changelogs.

This check can be disabled by tagging the PR with skip-changelog-check.

@dcharkes dcharkes marked this pull request as ready for review December 18, 2025 09:44
@dcharkes dcharkes requested a review from mosuem December 18, 2025 09:44
// BSD-style license that can be found in the LICENSE file.

import 'identifier.dart' show Identifier;
import 'identifier.dart';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally like shows, makes it easier to grep which symbols are where. I am trying to use them by default everywhere now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a lot of manual churn if we don't have (a) a lint to enforce it, and (2) the auto-import features in the IDE use that, and (3) have auto-fixes.

Opt me in when we have it effortless!

It might also help with analyzer speed in our projects! 🥳

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I also would love a lint for this... @bwilkerson ;)

@coveralls
Copy link

Coverage Status

coverage: 80.487% (-11.6%) from 92.127%
when pulling 57a1778 on record-use-syntax
into 4341e37 on main.

@coveralls
Copy link

coveralls commented Dec 18, 2025

Coverage Status

coverage: 80.568% (-11.6%) from 92.127%
when pulling fba73e8 on record-use-syntax
into 4341e37 on main.

@dcharkes dcharkes merged commit 9a11537 into main Dec 19, 2025
20 checks passed
@dcharkes dcharkes deleted the record-use-syntax branch December 19, 2025 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants