Skip to content

Commit 9d6257d

Browse files
authored
Upgrade dartdoc: 0.30.0+1 (#3234)
* Upgrade pub_dartdoc * Update customizations * Remove unsupported parameter: hosted-url. * changelog
1 parent 94bc996 commit 9d6257d

23 files changed

+601
-790
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Important changes to data-models, configuration and migrations between each
22
AppEngine version, listed here to ease deployment and troubleshooting.
33

44
## Next Release (replace with git tag when deployed)
5-
* Bumped runtimeVersion to `2020.01.02`.
6-
* Upgraded dartdoc to `0.29.3`.
5+
* Bumped runtimeVersion to `2020.01.10`.
6+
* Upgraded dartdoc to `0.30.0+1`.
77
* Upgraded pana to `0.13.3`.
88

99
## `20191218t150816-all`

app/lib/dartdoc/customization.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,18 @@ class DartdocCustomizer {
7474

7575
void _stripCanonicalUrl(Element elem) {
7676
if (elem == null) return;
77-
final href = elem.attributes['href'];
77+
String href = elem.attributes['href'];
7878
if (href != null && href.endsWith('/index.html')) {
79-
elem.attributes['href'] =
80-
href.substring(0, href.length - 'index.html'.length);
79+
href = href.substring(0, href.length - 'index.html'.length);
80+
}
81+
if (href != null) {
82+
// Since the <base /> tag removal, dartdoc calculates the canonical URL
83+
// with extra `../../` segments. Removing them as a temporary fix.
84+
// https://github.com/dart-lang/dartdoc/issues/2122
85+
// TODO: Remove this after the dartdoc issue is fixed
86+
href = href.replaceAll('../', '');
87+
88+
elem.attributes['href'] = href;
8189
}
8290
}
8391

app/lib/dartdoc/dartdoc_runner.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ class DartdocJobProcessor extends JobProcessor {
7575
'--sdk-docs',
7676
'--output',
7777
outputDir,
78-
'--hosted-url',
79-
siteRoot,
8078
'--link-to-remote',
8179
'--no-validate-links',
8280
];
@@ -381,8 +379,6 @@ class DartdocJobProcessor extends JobProcessor {
381379
pkgPath,
382380
'--output',
383381
outputDir,
384-
'--hosted-url',
385-
siteRoot,
386382
'--rel-canonical-prefix',
387383
canonicalUrl,
388384
if (!isReduced) '--link-to-remote',

app/lib/shared/versions.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ final RegExp runtimeVersionPattern = RegExp(r'\d{4}\.\d{2}\.\d{2}');
1717
/// Increment the version when a change is significant enough to trigger
1818
/// reprocessing, including: version change in pana, dartdoc, or the SDKs,
1919
/// or when an feature or bugfix should be picked up by the analysis ASAP.
20-
const String runtimeVersion = '2020.01.02';
20+
const String runtimeVersion = '2020.01.10';
2121
final Version semanticRuntimeVersion = Version.parse(runtimeVersion);
2222

2323
/// The version which marks the earliest version of the data which we'd like to
@@ -26,7 +26,7 @@ final Version semanticRuntimeVersion = Version.parse(runtimeVersion);
2626
///
2727
/// Make sure that at least two versions are kept here as the next candidates
2828
/// when the version switch happens:
29-
/// - 2020.01.02
29+
/// - 2020.01.10
3030
/// - 2019.12.13
3131
/// - 2019.12.09
3232
final String gcBeforeRuntimeVersion = '2019.11.29';
@@ -46,7 +46,7 @@ final String flutterVersion = '1.12.13+hotfix.5';
4646
final Version semanticFlutterVersion = Version.parse(flutterVersion);
4747

4848
// keep in-sync with pkg/pub_dartdoc/pubspec.yaml
49-
final String dartdocVersion = '0.29.3';
49+
final String dartdocVersion = '0.30.0+1';
5050
final Version semanticDartdocVersion = Version.parse(dartdocVersion);
5151

5252
// Version that control the dartdoc serving.

app/test/dartdoc/golden/pana_0.12.2_index.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,12 @@
44
<meta charset="utf-8">
55
<meta http-equiv="X-UA-Compatible" content="IE=edge">
66
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no">
7-
<meta name="generator" content="made with love by dartdoc 0.29.3">
7+
<meta name="generator" content="made with love by dartdoc 0.30.0+1">
88
<meta name="description" content="pana API docs, for the Dart programming language.">
99
<title>pana - Dart API docs</title>
10-
<link rel="canonical" href="https://pub.dartlang.org/documentation/pana/0.12.2/index.html">
10+
<link rel="canonical" href="https://pub.dev/documentation/pana/0.12.2/index.html">
1111

12+
1213
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
1314
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
1415
<link rel="stylesheet" href="static-assets/github.css">
@@ -128,7 +129,7 @@ <h2>Libraries</h2>
128129
<script src="static-assets/typeahead.bundle.min.js"></script>
129130
<script src="static-assets/highlight.pack.js"></script>
130131
<script src="static-assets/URI.js"></script>
131-
<script src="static-assets/script.js"></script>
132+
<script id="dartdoc_script_js" src="static-assets/script.js"></script>
132133
<!-- footer placeholder -->
133134

134135
</body>

app/test/dartdoc/golden/pana_0.12.2_index.out.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
<meta charset="utf-8"/>
77
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
88
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1, user-scalable=no"/>
9-
<meta name="generator" content="made with love by dartdoc 0.29.3"/>
9+
<meta name="generator" content="made with love by dartdoc 0.30.0+1"/>
1010
<meta name="description" content="pana API docs, for the Dart programming language."/>
1111
<title>pana - Dart API docs</title>
1212
<link rel="alternate" href="/documentation/pana/latest/"/>
13-
<link rel="canonical" href="https://pub.dartlang.org/documentation/pana/0.12.2/"/>
13+
<link rel="canonical" href="https://pub.dev/documentation/pana/0.12.2/"/>
1414
<link rel="stylesheet" type="text/css" href="/static/css/github-markdown.css?hash=t2ti0tfkd3q7dsh5njovil42c3bnhf5s"/>
1515
<link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet"/>
1616
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"/>
@@ -144,7 +144,7 @@ <h2>Libraries</h2>
144144
<script src="static-assets/typeahead.bundle.min.js"/>
145145
<script src="static-assets/highlight.pack.js"/>
146146
<script src="static-assets/URI.js"/>
147-
<script src="static-assets/script.js"/>
147+
<script id="dartdoc_script_js" src="static-assets/script.js"/>
148148
<!-- footer placeholder -->
149149
</body>
150150
</html>

0 commit comments

Comments
 (0)