From 23e34025f3e7f41999316f032f59a85d4c4a8055 Mon Sep 17 00:00:00 2001 From: Parker Lougheed Date: Tue, 10 Dec 2024 14:59:52 +0800 Subject: [PATCH] Move sound problems doc out of guides/ directory --- firebase.json | 7 +++- src/_data/glossary.yml | 2 +- src/_data/keywords.yml | 2 +- src/_data/side-nav.yml | 2 +- .../language => deprecated}/sound-problems.md | 0 src/content/guides/language/index.md | 37 ------------------- src/content/language/extend.md | 2 +- src/content/language/type-system.md | 4 +- .../resources/coming-from/js-to-dart.md | 2 +- src/content/resources/whats-new.md | 2 +- 10 files changed, 13 insertions(+), 47 deletions(-) rename src/content/{guides/language => deprecated}/sound-problems.md (100%) delete mode 100644 src/content/guides/language/index.md diff --git a/firebase.json b/firebase.json index 3f14cfff74..98e51a2094 100644 --- a/firebase.json +++ b/firebase.json @@ -213,11 +213,12 @@ { "source": "/googleapis", "destination": "https://github.com/dart-lang/googleapis", "type": 301 }, { "source": "/guides/get-started", "destination": "/overview", "type": 301 }, { "source": "/guides/google-apis", "destination": "/resources/google-apis", "type": 301 }, + { "source": "/guides/language", "destination": "/language", "type": 301 }, { "source": "/guides/language/analysis-options", "destination": "/tools/analysis", "type": 301 }, { "source": "/guides/language/cheatsheet", "destination": "/language", "type": 301 }, { "source": "/guides/language/coming-from/js-to-dart", "destination": "/resources/coming-from/js-to-dart", "type": 301 }, { "source": "/guides/language/coming-from/swift-to-dart", "destination": "/resources/coming-from/swift-to-dart", "type": 301 }, - { "source": "/guides/language/common-prob", "destination": "/guides/language/sound-problems", "type": 301 }, + { "source": "/guides/language/common-prob", "destination": "/deprecated/sound-problems", "type": 301 }, { "source": "/guides/language/concurrency", "destination": "/language/concurrency", "type": 301 }, { "source": "/guides/language/effective-dart", "destination": "/effective-dart", "type": 301 }, { "source": "/guides/language/effective-dart/:page*", "destination": "/effective-dart/:page*", "type": 301 }, @@ -229,10 +230,12 @@ { "source": "/guides/language/numbers", "destination": "/resources/language/number-representation", "type": 301 }, { "source": "/guides/language/sound-dart", "destination": "/language/type-system", "type": 301 }, { "source": "/guides/language/sound-faq", "destination": "/language/type-system", "type": 301 }, + { "source": "/guides/language/sound-problems", "destination": "/deprecated/sound-problems", "type": 301 }, { "source": "/guides/language/spec", "destination": "/resources/language/spec", "type": 301 }, { "source": "/guides/language/specifications", "destination": "/resources/language/spec", "type": 301 }, { "source": "/guides/language/specifications/:page*", "destination": "/resources/language/spec/versions/:page*", "type": 301 }, { "source": "/guides/language/type-system", "destination": "/language/type-system", "type": 301 }, + { "source": "/guides/language/**", "destination": "/language", "type": 301 }, { "source": "/guides/libraries", "destination": "/libraries", "type": 301 }, { "source": "/guides/libraries/create-library-packages", "destination": "/tools/pub/create-packages", "type": 301 }, { "source": "/guides/libraries/create-packages", "destination": "/tools/pub/create-packages", "type": 301 }, @@ -266,7 +269,7 @@ { "source": "/keyword/class", "destination": "/language/classes#instance-variables", "type": 301 }, { "source": "/keyword/const", "destination": "/language/variables#final-and-const", "type": 301 }, { "source": "/keyword/continue", "destination": "/language/loops#break-and-continue", "type": 301 }, - { "source": "/keyword/covariant", "destination": "/guides/language/sound-problems#the-covariant-keyword", "type": 301 }, + { "source": "/keyword/covariant", "destination": "/deprecated/sound-problems#the-covariant-keyword", "type": 301 }, { "source": "/keyword/default", "destination": "/language/branches#switch", "type": 301 }, { "source": "/keyword/deferred", "destination": "/language/libraries#lazily-loading-a-library", "type": 301 }, { "source": "/keyword/do", "destination": "/language/loops#while-and-do-while", "type": 301 }, diff --git a/src/_data/glossary.yml b/src/_data/glossary.yml index b2dfc3256c..8a0bced844 100644 --- a/src/_data/glossary.yml +++ b/src/_data/glossary.yml @@ -614,7 +614,7 @@ - text: "Covariance and contravariance" link: "https://en.wikipedia.org/wiki/Covariance_and_contravariance_(computer_science)" - text: "The covariant keyword" - link: "/guides/language/sound-problems#the-covariant-keyword" + link: "/deprecated/sound-problems#the-covariant-keyword" labels: - "language" - "type system" diff --git a/src/_data/keywords.yml b/src/_data/keywords.yml index 495b7ac181..8dd174964b 100644 --- a/src/_data/keywords.yml +++ b/src/_data/keywords.yml @@ -35,7 +35,7 @@ link: /language/loops#break-and-continue type: reserved - term: 'covariant' - link: /guides/language/sound-problems#the-covariant-keyword + link: /deprecated/sound-problems#the-covariant-keyword type: bit - term: 'default' link: /language/branches#switch diff --git a/src/_data/side-nav.yml b/src/_data/side-nav.yml index b065bf02f5..92f536517e 100644 --- a/src/_data/side-nav.yml +++ b/src/_data/side-nav.yml @@ -325,7 +325,7 @@ - title: Customizing static analysis permalink: /tools/analysis - title: Fixing common type problems - permalink: /guides/language/sound-problems + permalink: /deprecated/sound-problems - title: Fixing type promotion failures permalink: /tools/non-promotion-reasons - title: Linter rules diff --git a/src/content/guides/language/sound-problems.md b/src/content/deprecated/sound-problems.md similarity index 100% rename from src/content/guides/language/sound-problems.md rename to src/content/deprecated/sound-problems.md diff --git a/src/content/guides/language/index.md b/src/content/guides/language/index.md deleted file mode 100644 index a1c1d2f6aa..0000000000 --- a/src/content/guides/language/index.md +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: "Overview: The Dart language" -short-title: Dart language -toc: false -description: Discover resources for learning the Dart programming language. ---- - -These two resources are popular with both beginning Dart developers and experts. - -
-
-

Language tour

-

A walk through all of the major features of the Dart language.

-
-
-

Effective Dart

-

A set of guides on how to write the best Dart code - possible. Guidelines cover style, documentation, usage, - and design.

-
-
- -## Other resources - -* [Dart's type system](/language/type-system)
- Learn about Dart's sound type system. - * [Fixing common type problems](/guides/language/sound-problems)
- How to fix errors and warnings you may encounter. -* [Customizing static analysis](/tools/analysis)
- A guide to customizing the analyzer using an analysis options file. -* Asynchronous programming - * [Futures, async, await](/libraries/async/async-await)
- Learn about and practice writing asynchronous code, using DartPad. - * [Streams](/libraries/async/using-streams)
- A beginner's guide to handling sequences of asynchronous events. -* [Specification](/resources/language/spec)
- A definitive, highly technical description of the Dart language. diff --git a/src/content/language/extend.md b/src/content/language/extend.md index 58e30a8959..575af4a4ea 100644 --- a/src/content/language/extend.md +++ b/src/content/language/extend.md @@ -78,7 +78,7 @@ it's similar to a downcast in that it can cause a type error at runtime. Still, narrowing the type is possible if the code can guarantee that a type error won't occur. In this case, you can use the -[`covariant` keyword](/guides/language/sound-problems#the-covariant-keyword) +[`covariant` keyword](/deprecated/sound-problems#the-covariant-keyword) in a parameter declaration. For details, see the [Dart language specification][]. diff --git a/src/content/language/type-system.md b/src/content/language/type-system.md index db4f609970..d3613dd6e8 100644 --- a/src/content/language/type-system.md +++ b/src/content/language/type-system.md @@ -179,7 +179,7 @@ subtype of the original parameter. :::note If you have a valid reason to use a subtype, you can use the -[`covariant` keyword](/guides/language/sound-problems#the-covariant-keyword). +[`covariant` keyword](/deprecated/sound-problems#the-covariant-keyword). ::: Consider the `chase(Animal)` method for the `Animal` class: @@ -488,7 +488,7 @@ and [Use sound parameter types when overriding methods](#use-proper-param-types) The following resources have further information on sound Dart: -* [Fixing common type problems](/guides/language/sound-problems) - +* [Fixing common type problems](/deprecated/sound-problems) - Errors you may encounter when writing sound Dart code, and how to fix them. * [Fixing type promotion failures](/tools/non-promotion-reasons) - Understand and learn how to fix type promotion errors. diff --git a/src/content/resources/coming-from/js-to-dart.md b/src/content/resources/coming-from/js-to-dart.md index 2f5d267530..4e1c30fe63 100644 --- a/src/content/resources/coming-from/js-to-dart.md +++ b/src/content/resources/coming-from/js-to-dart.md @@ -122,7 +122,7 @@ consider themselves as equal. ::: [Built-in types]: /language/built-in-types -[Dart Language Tour]: /guides/language +[Dart Language Tour]: /language For example: The equals operator `==` and the `identical()` method return `true` diff --git a/src/content/resources/whats-new.md b/src/content/resources/whats-new.md index 420e998090..76f148472d 100644 --- a/src/content/resources/whats-new.md +++ b/src/content/resources/whats-new.md @@ -548,7 +548,7 @@ we made the following changes to this site: * Added a section on customizing [`dart fix`][]. [Objective-C and Swift interop]: /interop/objective-c-interop -[Fixing common type problems]: /guides/language/sound-problems +[Fixing common type problems]: /deprecated/sound-problems [What not to commit]: /tools/pub/private-files [`dart pub get` Options]: /tools/pub/cmd/pub-get#options [`dart compile`]: /tools/dart-compile