Ack 2.0: primary-constructor models (analyzer 13.3, generator on Dart 3.13)

Open
#188 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
dart
Domain
tooling

Research direction

Start by reviewing PR #184 and the generator’s existing tests; the issue calls for tests covering /// @description on a primary-constructor parameter and on the class. Check the Minimum Dart SDK CI job and the cited annotation files, ack_model.dart:16 and schemable.dart:11, before the Dart 3.13 generator job. Done means the PR contains only the primary-constructor and analyzer changes, the required checks pass, and the changelog and formatter updates are included.

Written by the indexing model from the issue text.

Description

2.0 enhancement

Tracking issue for primary-constructor models, deferred from 1.7 to 2.0.

The work

#184 adds @Schemable() on a Dart primary constructor:

/// @description Which habit a screen is about.
@Schemable()
final class HabitDto({
  /// @description A saved habit's id.
  required final String habitId,
}) with _$HabitDtoAck;

Reading a primary constructor requires analyzer ^13.3.0, which moves ack_generator to Dart 3.13. Core ack keeps its Dart 3.9 minimum. That move is why this is held for 2.0.

What 1.7 takes from #184 instead

The analyzer-independent part lands separately in the 1.7 line: the annotations move into ack, the ack_annotations package is removed, and @Schemable() is the single annotation. #184 stays open for the rest.

Before this can merge

  • Rebase #184 onto main once the 1.7 part has landed, so it contains only the primary-constructor and analyzer changes.
  • Fix the "Minimum Dart SDK" check: Dart 3.9 flags doc-comment links to the deprecated annotations (ack_model.dart:16, schemable.dart:11). Until it passes, the Dart 3.13 generator job never runs in CI.
  • Add a generator test for a /// @description tag on a primary-constructor parameter and on the class.
  • Record in the changelog that the generated mixin's abstract getters require @override on a model's fields.
  • Format the branch with the Dart 3.13 formatter. About half of #184's current diff is that reformat; a first commit with only the toolchain bump and dart format keeps the rest reviewable.
  • Consumers that share a workspace with another generator need that generator on analyzer 13.3 too. mix_generator 2.2.0 declares analyzer >=9.0.0 <11.0.0, and it does not compile on 13.3 as is: FieldElement.isSynthetic was removed in analyzer 11 (mix_generator/lib/src/modifier_generator.dart:64).

Related

  • #184: the pull request.
  • #185: types that carry their own schema.
  • #186: JSON Schema Draft 2020-12, also 2.0.
Dominant language
Dart
Stars
64
Forks
3
Avg merge
17h 32m
Merged PRs (30d)
33

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from btwld/ack

All issues in btwld/ack

Similar issues

More Dart issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.