Skip to content

dartdoc should follow package allow-list on nnbd experiment #2211

@jcollins-g

Description

@jcollins-g

Updated:

Dartdoc can treat the packages on the allow-list as having the experiment flag enabled by default.

  • A package that otherwise appears to be migrated via package versioning but no other indications should be treated as legacy, and crash if NNBD is used.
  • A package that is apparently migrated via pubspec version constraints and has an analysis_options.yaml flag indicating the NNBD experiment is enabled should be treated as a migrated package, regardless of the allow list contents.
  • A package that is apparently migrated via pubspec version constraints and is in the package allow-list should be treated as a migrated package, regardless of the contents of analysis_options.yaml.
  • Because dartdoc can not control experiment options in the analyzer in a package-specific way, documenting a set of packages at the same time with mixed modes will not be allowed. Most usages of dartdoc will not be impacted, but this may have implications for how flutter docs are generated. TBD: determine impact and either remove this restriction (very hard), change flutter doc generation to build sub-packages individually, or force all packages flutter depends on to be migrated.. -- This should not be an issue with how the analyzer will be working with the flags.

A package documented as "legacy" will show no star * or nullable ? type information. A package documented as NNBD will show nullable type information per #2210.

prior to offline discussion with @jakemac53 :

For the tech preview, it seems the right thing to do for dartdoc is to enable display of nullability (#2210) for packages in the allow-list as defined here. For any package in this list, dartdoc should assume both that it is migrated, and should be documented with its strong-mode restrictions.

A migrated package that does not appear on this list will be documented with its weak-mode interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failurestype-enhancementA request for a change that isn't a bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions