Skip to content

Remove all @deprecated elements. #3250

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 12, 2023
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 7.0.0-dev

* Remove all `@deprecated` elements.
* Remove deprecated `<nodoc>` syntax.

## 6.3.0
* Add a hideImplementations directive to disable showing constant
implementations alongside one-line docs on class pages (#3398)
Expand Down
2 changes: 1 addition & 1 deletion dartdoc_options.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dartdoc:
linkToSource:
root: '.'
uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v6.3.0/%f%#L%l%'
uriTemplate: 'https://github.com/dart-lang/dartdoc/blob/v7.0.0-dev/%f%#L%l%'
8 changes: 0 additions & 8 deletions lib/dartdoc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,8 @@ library dartdoc;

export 'package:dartdoc/src/dartdoc.dart';
export 'package:dartdoc/src/dartdoc_options.dart';
@Deprecated(
'Elements which are only exposed via this export will no longer be part of '
'the public API starting in dartdoc 7.0.0')
export 'package:dartdoc/src/element_type.dart';
export 'package:dartdoc/src/generator/generator.dart';
export 'package:dartdoc/src/model/indexable.dart' show Kind;
@Deprecated(
'Elements which are only exposed via this export will no longer be part of '
'the public API starting in dartdoc 7.0.0')
export 'package:dartdoc/src/model/model.dart';
export 'package:dartdoc/src/model/package_builder.dart';
export 'package:dartdoc/src/model/package_graph.dart';
export 'package:dartdoc/src/package_config_provider.dart';
Expand Down
1 change: 1 addition & 0 deletions lib/src/dartdoc_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import 'package:args/args.dart';
import 'package:dartdoc/src/experiment_options.dart';
import 'package:dartdoc/src/failure.dart';
import 'package:dartdoc/src/io_utils.dart';
import 'package:dartdoc/src/model/model.dart';
import 'package:dartdoc/src/package_meta.dart';
import 'package:dartdoc/src/source_linker.dart';
import 'package:dartdoc/src/tool_definition.dart';
Expand Down
6 changes: 0 additions & 6 deletions lib/src/generator/dartdoc_generator_backend.dart

This file was deleted.

3 changes: 0 additions & 3 deletions lib/src/generator/generator_backend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ import 'package:dartdoc/src/version.dart';
import 'package:dartdoc/src/warnings.dart';
import 'package:path/path.dart' as p show Context;

@Deprecated('Refer to GeneratorBackendBase directly')
typedef DartdocGeneratorBackend = GeneratorBackendBase;

/// Configuration options for Dartdoc's default backend.
class DartdocGeneratorBackendOptions implements TemplateOptions {
@override
Expand Down
6 changes: 0 additions & 6 deletions lib/src/generator/generator_frontend.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,6 @@ import 'package:dartdoc/src/model_utils.dart';
import 'package:dartdoc/src/runtime_stats.dart';
import 'package:dartdoc/src/warnings.dart';

@Deprecated('Refer to GeneratorBackendBase directly')
export 'package:dartdoc/src/generator/generator_backend.dart'
show
// ignore: deprecated_member_use_from_same_package
DartdocGeneratorBackend;

/// A [Generator] that delegates rendering to a [GeneratorBackend] and delegates
/// file creation to a [FileWriter].
class GeneratorFrontEnd implements Generator {
Expand Down
4 changes: 2 additions & 2 deletions lib/src/generator/template_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ class ClassTemplateData extends InheritingContainerTemplateData<Class> {
);

@override
// Mustachio generation requires this unnecessary override.
// Likely a bug or serious missing feature in Mustachio.
// Mustachio generation requires this unnecessary override. Likely a bug or
// serious missing feature in Mustachio.
// ignore: unnecessary_overrides
Class get clazz => super.clazz;
}
Expand Down
92 changes: 0 additions & 92 deletions lib/src/generator/templates.runtime_renderers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5116,18 +5116,6 @@ class _Renderer_ExtensionTarget extends RendererBase<ExtensionTarget> {
parent: r);
},
),
'potentiallyApplicableExtensions': Property(
getValue: (CT_ c) => c.potentiallyApplicableExtensions,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(
c, remainingNames, 'List<Extension>'),
renderIterable: (CT_ c, RendererBase<CT_> r,
List<MustachioNode> ast, StringSink sink) {
return c.potentiallyApplicableExtensions.map((e) =>
_render_Extension(e, ast, r.template, sink, parent: r));
},
),
'potentiallyApplicableExtensionsSorted': Property(
getValue: (CT_ c) => c.potentiallyApplicableExtensionsSorted,
renderVariable: (CT_ c, Property<CT_> self,
Expand Down Expand Up @@ -5762,19 +5750,6 @@ class _Renderer_Field extends RendererBase<Field> {
parent: r, getters: _invisibleGetters['Feature']!));
},
),
'field': Property(
getValue: (CT_ c) => c.field,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(
c, remainingNames, 'FieldElement'),
isNullValue: (CT_ c) => c.field == null,
renderValue: (CT_ c, RendererBase<CT_> r,
List<MustachioNode> ast, StringSink sink) {
renderSimple(c.field, ast, r.template, sink,
parent: r, getters: _invisibleGetters['FieldElement']!);
},
),
'fileName': Property(
getValue: (CT_ c) => c.fileName,
renderVariable:
Expand Down Expand Up @@ -10783,13 +10758,6 @@ class _Renderer_ModelElement extends RendererBase<ModelElement> {
_render_String(c.htmlId, ast, r.template, sink, parent: r);
},
),
'isAsynchronous': Property(
getValue: (CT_ c) => c.isAsynchronous,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.isAsynchronous == true,
),
'isCallable': Property(
getValue: (CT_ c) => c.isCallable,
renderVariable: (CT_ c, Property<CT_> self,
Expand Down Expand Up @@ -10832,13 +10800,6 @@ class _Renderer_ModelElement extends RendererBase<ModelElement> {
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.isEnumValue == true,
),
'isExecutable': Property(
getValue: (CT_ c) => c.isExecutable,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.isExecutable == true,
),
'isFinal': Property(
getValue: (CT_ c) => c.isFinal,
renderVariable: (CT_ c, Property<CT_> self,
Expand All @@ -10853,27 +10814,6 @@ class _Renderer_ModelElement extends RendererBase<ModelElement> {
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.isLate == true,
),
'isLocalElement': Property(
getValue: (CT_ c) => c.isLocalElement,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.isLocalElement == true,
),
'isPropertyAccessor': Property(
getValue: (CT_ c) => c.isPropertyAccessor,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.isPropertyAccessor == true,
),
'isPropertyInducer': Property(
getValue: (CT_ c) => c.isPropertyInducer,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.isPropertyInducer == true,
),
'isPublic': Property(
getValue: (CT_ c) => c.isPublic,
renderVariable: (CT_ c, Property<CT_> self,
Expand All @@ -10888,13 +10828,6 @@ class _Renderer_ModelElement extends RendererBase<ModelElement> {
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.isPublicAndPackageDocumented == true,
),
'isStatic': Property(
getValue: (CT_ c) => c.isStatic,
renderVariable: (CT_ c, Property<CT_> self,
List<String> remainingNames) =>
self.renderSimpleVariable(c, remainingNames, 'bool'),
getBool: (CT_ c) => c.isStatic == true,
),
'kind': Property(
getValue: (CT_ c) => c.kind,
renderVariable: (CT_ c, Property<CT_> self,
Expand Down Expand Up @@ -11040,29 +10973,6 @@ class _Renderer_ModelElement extends RendererBase<ModelElement> {
parent: r);
},
),
'linkedParamsNoMetadataOrNames': Property(
getValue: (CT_ c) => c.linkedParamsNoMetadataOrNames,
renderVariable:
(CT_ c, Property<CT_> self, List<String> remainingNames) {
if (remainingNames.isEmpty) {
return self.getValue(c).toString();
}
var name = remainingNames.first;
var nextProperty =
_Renderer_String.propertyMap().getValue(name);
return nextProperty.renderVariable(
self.getValue(c) as String,
nextProperty,
[...remainingNames.skip(1)]);
},
isNullValue: (CT_ c) => false,
renderValue: (CT_ c, RendererBase<CT_> r,
List<MustachioNode> ast, StringSink sink) {
_render_String(
c.linkedParamsNoMetadataOrNames, ast, r.template, sink,
parent: r);
},
),
'location': Property(
getValue: (CT_ c) => c.location,
renderVariable:
Expand Down Expand Up @@ -17109,7 +17019,6 @@ const _invisibleGetters = {
'specialClasses'
},
'PackageMeta': {
'description',
'dir',
'hashCode',
'homepage',
Expand All @@ -17118,7 +17027,6 @@ const _invisibleGetters = {
'isValid',
'name',
'pathContext',
'repository',
'requiresFlutter',
'resolvedDir',
'resourceProvider',
Expand Down
23 changes: 0 additions & 23 deletions lib/src/markdown_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,6 @@ const maxPriorContext = 20;
/// generic.
const maxPostContext = 30;

@Deprecated('Public access to this variable is deprecated')
final allBeforeFirstNewline = _allBeforeFirstNewline;
@Deprecated('Public access to this variable is deprecated')
final allAfterLastNewline = _allAfterLastNewline;

final RegExp _allBeforeFirstNewline = RegExp(r'^.*\n', multiLine: true);
final RegExp _allAfterLastNewline = RegExp(r'\n.*$', multiLine: true);

Expand Down Expand Up @@ -308,28 +303,10 @@ class MarkdownDocument extends md.Document {
);
}

@Deprecated("MarkdownDocument's unnamed constructor is deprecated. Use "
'[MarkdownDocument.withElementLinkResolver]')
MarkdownDocument({
Iterable<md.BlockSyntax>? blockSyntaxes,
Iterable<md.InlineSyntax>? inlineSyntaxes,
md.ExtensionSet? extensionSet,
md.Resolver? linkResolver,
md.Resolver? imageLinkResolver,
}) : this._(
blockSyntaxes: blockSyntaxes,
inlineSyntaxes: inlineSyntaxes,
extensionSet: extensionSet,
linkResolver: linkResolver,
imageLinkResolver: imageLinkResolver,
);

MarkdownDocument._({
super.blockSyntaxes,
super.inlineSyntaxes,
super.extensionSet,
super.linkResolver,
super.imageLinkResolver,
});

/// Parses markdown text, collecting the first [md.Node] or all of them
Expand Down
17 changes: 4 additions & 13 deletions lib/src/model/comment_referable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ import 'package:dartdoc/src/model/model_object_builder.dart';
import 'package:dartdoc/src/model/nameable.dart';
import 'package:meta/meta.dart';

@Deprecated('Public access to this class is deprecated')
typedef ReferenceChildrenLookup = _ReferenceChildrenLookup;

class _ReferenceChildrenLookup {
final String lookup;
final List<String> remaining;
Expand Down Expand Up @@ -130,7 +127,7 @@ mixin CommentReferable implements Nameable, ModelBuilderInterface {
allowTree: allowTree, filter: filter);
}

/// Given a [result] found in an implementation of [lookupViaScope] or
/// Given a [result] found in an implementation of [_lookupViaScope] or
/// [_ReferenceChildrenLookup], recurse through children, skipping over
/// results that do not match the filter.
CommentReferable? _recurseChildrenAndFilter(
Expand All @@ -157,11 +154,6 @@ mixin CommentReferable implements Nameable, ModelBuilderInterface {
return returnValue;
}

@Deprecated('Public access to this method is deprecated')
// ignore: library_private_types_in_public_api
Iterable<_ReferenceChildrenLookup> childLookups(List<String> reference) =>
_childLookups(reference);

/// A list of lookups that should be attempted on children based on
/// [reference].
///
Expand All @@ -174,7 +166,7 @@ mixin CommentReferable implements Nameable, ModelBuilderInterface {
reference.sublist(index + 1)))
.toList(growable: false);

/// Map of [referenceName] to the elements that are a member of [this], but
/// Map of [referenceName] to the elements that are a member of `this`, but
/// not this model element itself. Can be cached.
///
/// There is no need to duplicate references here that can be found via
Expand Down Expand Up @@ -202,10 +194,9 @@ mixin CommentReferable implements Nameable, ModelBuilderInterface {
// TODO(jcollins-g): Eliminate need for this in markdown_processor.
Library? get library => null;

@internal

/// For testing / comparison only, get the comment referable from where this
/// [ElementType] was defined. Override where an [Element] is available.
/// `ElementType` was defined. Override where an [Element] is available.
@internal
CommentReferable get definingCommentReferable => this;
}

Expand Down
17 changes: 6 additions & 11 deletions lib/src/model/extension_target.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,12 @@ mixin ExtensionTarget on ModelElement {
/// This is defined as those extensions where an instantiation of the type
/// defined by [element] can exist where this extension applies, not including
/// any extension that applies to every type.
@Deprecated('Use potentiallyApplicableExtensionsSorted')
late final List<Extension> potentiallyApplicableExtensions = packageGraph
.documentedExtensions
.where((e) => !e.alwaysApplies)
.where((e) => e.couldApplyTo(this))
.toList(growable: false)
..sort(byName);
late final List<Extension> potentiallyApplicableExtensionsSorted =
packageGraph.documentedExtensions
.where((e) => !e.alwaysApplies)
.where((e) => e.couldApplyTo(this))
.toList(growable: false)
..sort(byName);

ElementType get modelType;

List<Extension> get potentiallyApplicableExtensionsSorted =>
// ignore: deprecated_member_use_from_same_package
potentiallyApplicableExtensions;
}
4 changes: 0 additions & 4 deletions lib/src/model/field.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ class Field extends ModelElement
@override
bool get isInherited => _isInherited;

@override
bool get isStatic => element.isStatic;

@override
Expand Down Expand Up @@ -141,9 +140,6 @@ class Field extends ModelElement
return allFeatures;
}

@Deprecated('Use `element`')
FieldElement? get field => element;

@override
String get fileName =>
'${isConst ? '$name-constant' : name}.${fileStructure.fileType}';
Expand Down
1 change: 0 additions & 1 deletion lib/src/model/method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ class Method extends ModelElement
if (isInherited) Feature.inherited,
};

@override
bool get isStatic => element.isStatic;

@override
Expand Down
Loading