Skip to content

Commit

Permalink
Remove mostly empty tutorials and codelabs section from sidenav (#5858)
Browse files Browse the repository at this point in the history
- Supersedes #4875 to make way
for new getting started content.
- Begins consolidating the idea of "codelab" and "tutorial", for a
future where we drop codelabs from the site.
- Add codelabs and tutorial not already in sidenav elsewhere to the
sidenav.
- Keep tutorial index, but put it in under resources.

Closes #4875

---------

Co-authored-by: Anthony Sansone <[email protected]>
  • Loading branch information
parlough and atsansone authored Jun 10, 2024
1 parent d46161e commit b2b5c71
Show file tree
Hide file tree
Showing 27 changed files with 130 additions and 155 deletions.
13 changes: 8 additions & 5 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
{ "source": "/articles/archive/event-loop", "destination": "https://medium.com/dartlang/dart-asynchronous-programming-isolates-and-event-loops-bffc3e296a6a", "type": 301 },
{ "source": "/articles/archive/numeric-computation", "destination": "/guides/language/numbers", "type": 301 },
{ "source": "/articles/archive/zones", "destination": "/libraries/async/zones", "type": 301 },
{ "source": "/articles/await-async", "destination": "/codelabs/async-await", "type": 301 },
{ "source": "/articles/await-async", "destination": "/libraries/async/async-await", "type": 301 },
{ "source": "/articles/broadcast-streams", "destination": "https://medium.com/dartlang/dart-asynchronous-programming-streams-dab952023ed7", "type": 301 },
{ "source": "/articles/converters-and-codecs", "destination": "/libraries/convert/converters-and-codecs", "type": 301 },
{ "source": "/articles/creating-streams", "destination": "/libraries/async/creating-streams", "type": 301 },
Expand All @@ -64,7 +64,7 @@
{ "source": "/articles/js-dart-interop", "destination": "/web/libraries#js-interop", "type": 301 },
{ "source": "/articles/json-web-service", "destination": "/guides/json", "type": 301 },
{ "source": "/articles/language", "destination": "/language", "type": 301 },
{ "source": "/articles/language/await-async", "destination": "/codelabs/async-await", "type": 301 },
{ "source": "/articles/language/await-async", "destination": "/libraries/async/async-await", "type": 301 },
{ "source": "/articles/language/mixins", "destination": "/language/mixins", "type": 301 },
{ "source": "/articles/language/optional-types", "destination": "/resources/faq#types", "type": 301 },
{ "source": "/articles/libraries", "destination": "/libraries", "type": 301 },
Expand All @@ -84,7 +84,7 @@
{ "source": "/articles/server{,/**}", "destination": "/server", "type": 301 },
{ "source": "/articles/snapshots", "destination": "/tools/dart-compile", "type": 301 },
{ "source": "/articles/style-guide{,/**}", "destination": "/effective-dart/style", "type": 301 },
{ "source": "/articles/using-future-based-apis{,/**}", "destination": "/codelabs/async-await", "type": 301 },
{ "source": "/articles/using-future-based-apis{,/**}", "destination": "/libraries/async/async-await", "type": 301 },
{ "source": "/articles/why-dart-types", "destination": "/resources/faq#types", "type": 301 },
{ "source": "/articles/zones", "destination": "/libraries/async/zones", "type": 301 },
{ "source": "/assets/dart-logo-for-shares*.png", "destination": "/assets/img/logo/dart-logo-for-shares.png", "type": 301 },
Expand All @@ -96,6 +96,9 @@
{ "source": "/cl", "destination": "https://dart-review.googlesource.com/q/status:open+-is:wip", "type": 301 },
{ "source": "/cl/:rest*", "destination": "https://dart-review.googlesource.com/c/sdk/+/:rest*", "type": 301 },
{ "source": "/cloud{,/**}", "destination": "/server/google-cloud", "type": 301 },
{ "source": "/codelabs", "destination": "/tutorials", "type": 301 },
{ "source": "/codelabs/async-await", "destination": "/libraries/async/async-await", "type": 301 },
{ "source": "/codelabs/dart-cheatsheet", "destination": "/resources/dart-cheatsheet", "type": 301 },
{ "source": "/codelabs/null-safety{,/**}", "destination": "/null-safety/understanding-null-safety", "type": 301 },
{ "source": "/codelabs/server{,/**}", "destination": "/tutorials/server/httpserver", "type": 301 },
{ "source": "/code-of-conduct", "destination": "/community/code-of-conduct", "type": 301 },
Expand Down Expand Up @@ -139,7 +142,7 @@
{ "source": "/docs/tutorials/cmdline", "destination": "/tutorials/server/cmdline", "type": 301 },
{ "source": "/docs/tutorials/connect-dart-html", "destination": "/library/dart-html", "type": 301 },
{ "source": "/docs/tutorials/fetchdata", "destination": "/tutorials/server/fetch-data", "type": 301 },
{ "source": "/docs/tutorials/futures", "destination": "/codelabs/async-await", "type": 301 },
{ "source": "/docs/tutorials/futures", "destination": "/libraries/async/async-await", "type": 301 },
{ "source": "/docs/tutorials/get-started", "destination": "/tutorials/server/get-started", "type": 301 },
{ "source": "/docs/tutorials/httpserver", "destination": "/tutorials/server/httpserver", "type": 301 },
{ "source": "/docs/tutorials/indexeddb{,/**}", "destination": "https://api.dart.dev/stable/dart-indexed_db/dart-indexed_db-library.html", "type": 301 },
Expand Down Expand Up @@ -317,7 +320,7 @@
{ "source": "/tutorials/dart-vm", "destination": "/tutorials/server", "type": 301 },
{ "source": "/tutorials/dart-vm/:page*", "destination": "/tutorials/server/:page*", "type": 301 },
{ "source": "/tutorials/language", "destination": "/language", "type": 301 },
{ "source": "/tutorials/language/futures", "destination": "/codelabs/async-await", "type": 301 },
{ "source": "/tutorials/language/futures", "destination": "/libraries/async/async-await", "type": 301 },
{ "source": "/tutorials/language/streams", "destination": "/libraries/async/using-streams", "type": 301 },
{ "source": "/tutorials/libraries", "destination": "/libraries", "type": 301 },
{ "source": "/tutorials/libraries/shared-pkgs", "destination": "/guides/packages", "type": 301 },
Expand Down
2 changes: 1 addition & 1 deletion src/_data/docs_cards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@
url: /tools/sdk
- name: Futures, async, await
description: How to write asynchronous Dart code that uses futures and the async and await keywords.
url: /codelabs/async-await
url: /libraries/async/async-await
46 changes: 19 additions & 27 deletions src/_data/side-nav.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
- title: Tutorials & codelabs
expanded: false
children:
- title: Tutorials
match-page-url-exactly: true
permalink: /tutorials
- title: Codelabs
expanded: true
children:
- title: List of Dart codelabs
match-page-url-exactly: true
permalink: /codelabs
- title: Language cheatsheet
permalink: /codelabs/dart-cheatsheet
- title: Iterable collections
permalink: /codelabs/iterables
- title: Asynchronous programming
permalink: /codelabs/async-await

- title: Language
expanded: false
children:
Expand Down Expand Up @@ -57,6 +38,8 @@
permalink: /language/patterns
- title: Pattern types
permalink: /language/pattern-types
- title: Applied tutorial
permalink: https://codelabs.developers.google.com/codelabs/dart-patterns-records
- title: Functions
permalink: /language/functions
- title: Control flow
Expand Down Expand Up @@ -138,12 +121,18 @@
- title: dart:html
permalink: /libraries/dart-html
- divider
- title: Using streams
permalink: /libraries/async/using-streams
- title: Creating streams
permalink: /libraries/async/creating-streams
- title: Futures and error handling
permalink: /libraries/async/futures-error-handling
- title: Iterable collections
permalink: /libraries/collections/iterables
- title: Asynchronous programming
children:
- title: Tutorial
permalink: /libraries/async/async-await
- title: Futures and error handling
permalink: /libraries/async/futures-error-handling
- title: Using streams
permalink: /libraries/async/using-streams
- title: Creating streams
permalink: /libraries/async/creating-streams

- title: Effective Dart
expanded: false
Expand Down Expand Up @@ -199,8 +188,6 @@
- title: Development
expanded: false
children:
- title: Futures, async, await
permalink: /codelabs/async-await
- title: JSON
permalink: /guides/json
- title: Number representation
Expand Down Expand Up @@ -355,6 +342,8 @@
- title: Resources
expanded: false
children:
- title: Language cheatsheet
permalink: /resources/dart-cheatsheet
- title: Breaking changes
permalink: /resources/breaking-changes
- title: Language evolution
Expand All @@ -379,6 +368,9 @@
permalink: /resources/books
- title: Videos
permalink: /resources/videos
- title: Tutorials
match-page-url-exactly: true
permalink: /tutorials

- title: Related sites
expanded: true
Expand Down
37 changes: 0 additions & 37 deletions src/content/codelabs/index.md

This file was deleted.

4 changes: 2 additions & 2 deletions src/content/guides/language/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ These two resources are popular with both beginning Dart developers and experts.
* [Customizing static analysis](/tools/analysis)<br>
A guide to customizing the analyzer using an analysis options file.
* Asynchronous programming
* [Futures, async, await](/codelabs/async-await)<br>
* [Futures, async, await](/libraries/async/async-await)<br>
Learn about and practice writing asynchronous code, using DartPad.
* [Streams](/tutorials/language/streams)<br>
* [Streams](/libraries/async/using-streams)<br>
A beginner's guide to handling sequences of asynchronous events.
* [Specification](/guides/language/spec)<br>
A definitive, highly technical description of the Dart language.
12 changes: 6 additions & 6 deletions src/content/guides/whats-new.md
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@ we made the following changes to this site:
* Introduced a new section to the language tour documenting
[initializing formal parameters][].
* Documented DartPad's [support for packages][].
* Fixed formatting in the [asynchronous programming codelab][]
* Fixed formatting in the [asynchronous programming tutorial][]
and elaborated on [why asynchronous code matters][].
* Updated the [security][] page to match our current security practices.
* Added a key binding (`/`) to automatically focus the search bar.
Expand Down Expand Up @@ -621,8 +621,8 @@ we made the following changes to this site:
[native types]: /interop/c-interop#interface-with-native-types
[initializing formal parameters]: /language/constructors#use-initializing-formal-parameters
[support for packages]: /tools/dartpad#library-support
[asynchronous programming codelab]: /codelabs/async-await
[why asynchronous code matters]: /codelabs/async-await#why-asynchronous-code-matters
[asynchronous programming tutorial]: /libraries/async/async-await
[why asynchronous code matters]: /libraries/async/async-await#why-asynchronous-code-matters
[security]: /security


Expand Down Expand Up @@ -851,7 +851,7 @@ we made the following changes to this site:
[HTTP server tutorial]: /tutorials/server/httpserver
[`lints`]: {{site.pub-pkg}}/lints
[Numbers in Dart]: /guides/language/numbers
[streams tutorial]: /tutorials/language/streams
[streams tutorial]: /libraries/async/using-streams
[typedef section]: /language/typedefs
[Using Google APIs]: /resources/google-apis
[Using Google Cloud]: /server/google-cloud
Expand Down Expand Up @@ -895,7 +895,7 @@ In addition to bug fixes and incremental improvements, we made the following cha
* Updated the [language evolution page][evolution]
to add information about language versioning
and to reflect Dart 2.12.
* Updated the [library tour][] and [codelabs][]
* Updated the [library tour][] and [tutorials][]
to reflect sound null safety.
* Updated pages across the site to use [the `dart` tool][]
instead of deprecated commands.
Expand All @@ -918,7 +918,7 @@ We also switched from Travis CI to GitHub Actions, and we made multiple CSS chan
[language tour]: /language
[`late` variables]: /language/variables#late-variables
[library tour]: /libraries
[codelabs]: /codelabs
[tutorials]: /tutorials
[the `dart` tool]: /tools/dart-tool
[`dart analyze`]: /tools/dart-analyze
[`dart compile`]: /tools/dart-compile
Expand Down
4 changes: 2 additions & 2 deletions src/content/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<div class="animated-bullet"></div>
</div>
<div class="bullet-text">
Mature and complete <a href="/codelabs/async-await">async-await</a>
Mature and complete <a href="/libraries/async/async-await">async-await</a>
for user interfaces containing event-driven code, paired with
<a href="/language/concurrency">isolate-based concurrency</a>
</div>
Expand Down Expand Up @@ -256,7 +256,7 @@
<div class="animated-bullet"></div>
</div>
<div class="bullet-text">
Mature and complete <a href="/codelabs/async-await">async-await</a>
Mature and complete <a href="/libraries/async/async-await">async-await</a>
for user interfaces containing event-driven code, paired with
<a href="/language/concurrency">isolate-based concurrency</a>.
</div>
Expand Down
6 changes: 3 additions & 3 deletions src/content/language/async.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ When you need the result of a completed Future,
you have two options:

* Use `async` and `await`, as described here and in the
[asynchronous programming codelab](/codelabs/async-await).
[asynchronous programming tutorial](/libraries/async/async-await).
* Use the Future API, as described in the
[`dart:async` documentation](/libraries/dart-async#future).

Expand Down Expand Up @@ -117,7 +117,7 @@ use the [unawaited_futures linter rule][].
:::

For an interactive introduction to using futures, `async`, and `await`,
see the [asynchronous programming codelab](/codelabs/async-await).
see the [asynchronous programming tutorial](/libraries/async/async-await).


## Declaring async functions
Expand Down Expand Up @@ -149,7 +149,7 @@ If your function doesn't return a useful value,
make its return type `Future<void>`.

For an interactive introduction to using futures, `async`, and `await`,
see the [asynchronous programming codelab](/codelabs/async-await).
see the [asynchronous programming tutorial](/libraries/async/async-await).

{% comment %}
TODO #1117: Where else should we cover generalized void?
Expand Down
6 changes: 3 additions & 3 deletions src/content/language/concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,9 +224,9 @@ Stream<int> sumStream(Stream<int> stream) async* {
```

If you'd like to learn more about using `async`, `await`, `Stream`s and
`Future`s, visit the [asynchronous programming codelab][].
`Future`s, check out the [asynchronous programming tutorial][].

[asynchronous programming codelab]: /codelabs/async-await
[asynchronous programming tutorial]: /libraries/async/async-await

## Isolates

Expand Down Expand Up @@ -280,7 +280,7 @@ complete. A well-behaved app starts quickly, getting to the event loop as soon
as possible. The app then responds to each queued event promptly, using
asynchronous operations as necessary.

[async-await]: /codelabs/async-await
[async-await]: /libraries/async/async-await

### The isolate life cycle

Expand Down
4 changes: 2 additions & 2 deletions src/content/language/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ listed under **Language** in the left side menu.

For coverage of Dart's core libraries,
check out the [core library documentation](/libraries).
You can also try the [Dart cheatsheet codelab](/codelabs/dart-cheatsheet),
for a more hands-on introduction.
You can also check out the [Dart cheatsheet](/resources/dart-cheatsheet),
for a more interactive introduction.


## Hello World
Expand Down
2 changes: 1 addition & 1 deletion src/content/language/loops.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ for (final Candidate(:name, :yearsExperience) in candidates) {

:::tip
To practice using `for-in`, follow the
[Iterable collections codelab](/codelabs/iterables).
[Iterable collections tutorial](/libraries/collections/iterables).
:::

Iterable classes also have a [forEach()][] method as another option:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,32 @@ js: [{url: '/assets/js/inject_dartpad.js', defer: true}]
<?code-excerpt replace="/ *\/\/\s+ignore_for_file:[^\n]+\n//g; /(^|\n) *\/\/\s+ignore:[^\n]+\n/$1/g; /(\n[^\n]+) *\/\/\s+ignore:[^\n]+\n/$1\n/g"?>
<?code-excerpt plaster="none"?>

This codelab teaches you how to write asynchronous code using
This tutorial teaches you how to write asynchronous code using
futures and the `async` and `await` keywords.
Using embedded DartPad editors,
you can test your knowledge by running example code
and completing exercises.

To get the most out of this codelab, you should have the following:
To get the most out of this tutorial, you should have the following:

* Knowledge of [basic Dart syntax](/language).
* Some experience writing asynchronous code in another language.

This codelab covers the following material:
This tutorial covers the following material:

* How and when to use the `async` and `await` keywords.
* How using `async` and `await` affects execution order.
* How to handle errors from an asynchronous call
using `try-catch` expressions in `async` functions.

Estimated time to complete this codelab: 40-60 minutes.
Estimated time to complete this tutorial: 40-60 minutes.

:::note
This page uses embedded DartPads to display examples and exercises.
{% render 'dartpads-embedded-troubleshooting.md' %}
:::

The exercises in this codelab have partially completed code snippets.
The exercises in this tutorial have partially completed code snippets.
You can use DartPad to test your knowledge by completing the code and
clicking the **Run** button.
**Don't edit the test code in the `main` function or below**.
Expand Down Expand Up @@ -1078,13 +1078,13 @@ bool _logoutSucceeds = false;

## What's next?

Congratulations, you've finished the codelab! If you'd like to learn more, here
Congratulations, you've finished the tutorial! If you'd like to learn more, here
are some suggestions for where to go next:

- Play with [DartPad]({{site.dartpad}}).
- Try another [codelab](/codelabs).
- Try another [tutorial](/tutorials).
- Learn more about futures and asynchronous code in Dart:
- [Streams tutorial](/tutorials/language/streams):
- [Streams tutorial](/libraries/async/using-streams):
Learn how to work with a sequence of asynchronous events.
- [Concurrency in Dart](/language/concurrency):
Understand and learn how to implement concurrency in Dart.
Expand Down
2 changes: 1 addition & 1 deletion src/content/libraries/async/futures-error-handling.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ You don't need this page if your code uses
the language's asynchrony support:
`async`, `await`, and error handling using try-catch.
For more information, see the
[asynchronous programming codelab](/codelabs/async-await).
[asynchronous programming tutorial](/libraries/async/async-await).
:::


Expand Down
Loading

0 comments on commit b2b5c71

Please sign in to comment.