Skip to content

Commit

Permalink
Move /language images to be managed within /assets (#5192)
Browse files Browse the repository at this point in the history
This simplifies our site setup, as we work towards `/assets` being the
standard location for all asset like files.

Contributes to #5193

Contributes to #4473 by
allowing any related image optimization to be consolidated to one
location.

Contributes to #5177 by
making asset pass-through easier to setup.
  • Loading branch information
parlough authored Sep 19, 2023
1 parent a7d8f45 commit b8e5f5b
Show file tree
Hide file tree
Showing 14 changed files with 13 additions and 13 deletions.
File renamed without changes
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ the Dart code pauses while `readAsString()` executes non-Dart code,
in either the Dart virtual machine (VM) or the operating system (OS).
Once `readAsString()` returns a value, Dart code execution resumes.

![Flowchart-like figure showing app code executing from start to exit, waiting for native I/O in between](/language/concurrency/images/basics-await.png)
![Flowchart-like figure showing app code executing from start to exit, waiting for native I/O in between](/assets/img/language/concurrency/basics-await.png)

If you'd like to learn more about using `async`, `await`, and futures,
visit the [asynchronous programming codelab][].
Expand Down Expand Up @@ -209,7 +209,7 @@ Dart programs run in the main isolate by default.
It's the thread where a program starts to run and execute,
as shown in the following figure:

![A figure showing a main isolate, which runs `main()`, responds to events, and then exits](/language/concurrency/images/basics-main-isolate.png)
![A figure showing a main isolate, which runs `main()`, responds to events, and then exits](/assets/img/language/concurrency/basics-main-isolate.png)

Even single-isolate programs can execute smoothly.
Before continuing to the next line of code, these apps use
Expand All @@ -232,7 +232,7 @@ When the isolate's initial function returns,
the isolate stays around if it needs to handle events.
After handling the events, the isolate exits.

![A more general figure showing that any isolate runs some code, optionally responds to events, and then exits](/language/concurrency/images/basics-isolate.png)
![A more general figure showing that any isolate runs some code, optionally responds to events, and then exits](/assets/img/language/concurrency/basics-isolate.png)


### Event handling
Expand All @@ -243,15 +243,15 @@ For example, the following figure shows a repaint event,
followed by a tap event, followed by two repaint events.
The event loop takes events from the queue in first in, first out order.

![A figure showing events being fed, one by one, into the event loop](/language/concurrency/images/event-loop.png)
![A figure showing events being fed, one by one, into the event loop](/assets/img/language/concurrency/event-loop.png)

Event handling happens on the main isolate after `main()` exits.
In the following figure, after `main()` exits,
the main isolate handles the first repaint event.
After that, the main isolate handles the tap event,
followed by a repaint event.

![A figure showing the main isolate executing event handlers, one by one](/language/concurrency/images/event-handling.png)
![A figure showing the main isolate executing event handlers, one by one](/assets/img/language/concurrency/event-handling.png)

If a synchronous operation takes too much processing time,
the app can become unresponsive.
Expand All @@ -260,7 +260,7 @@ so subsequent events are handled too late.
The app might appear to freeze,
and any animation it performs might be jerky.

![A figure showing a tap handler with a too-long execution time](/language/concurrency/images/event-jank.png)
![A figure showing a tap handler with a too-long execution time](/assets/img/language/concurrency/event-jank.png)

In client apps, the result of a too-lengthy synchronous operation is often
[janky (non-smooth) UI animation][jank].
Expand All @@ -282,7 +282,7 @@ The worker isolate returns its result in a message when the worker exits.

[json]: {{site.flutter-docs}}/cookbook/networking/background-parsing

![A figure showing a main isolate and a simple worker isolate](/language/concurrency/images/isolate-bg-worker.png)
![A figure showing a main isolate and a simple worker isolate](/assets/img/language/concurrency/isolate-bg-worker.png)

Each isolate message can deliver one object,
which includes anything that's transitively reachable from that object.
Expand Down Expand Up @@ -406,7 +406,7 @@ Previous example's diagram and text for reference:
The following figure illustrates the communication between
the main isolate and the worker isolate:

![A figure showing the previous snippets of code running in the main isolate and in the worker isolate](/language/concurrency/images/isolate-api.png)
![A figure showing the previous snippets of code running in the main isolate and in the worker isolate](/assets/img/language/concurrency/isolate-api.png)
{% endcomment %}

#### Sending closures with isolates
Expand Down Expand Up @@ -467,7 +467,7 @@ One common pattern, which the following figure shows,
is for the main isolate to send a request message to the worker isolate,
which then sends one or more reply messages.

![A figure showing the main isolate spawning the isolate and then sending a request message, which the worker isolate responds to with a reply message; two request-reply cycles are shown](/language/concurrency/images/isolate-custom-bg-worker.png)
![A figure showing the main isolate spawning the isolate and then sending a request message, which the worker isolate responds to with a reply message; two request-reply cycles are shown](/assets/img/language/concurrency/isolate-custom-bg-worker.png)

Check out the [long_running_isolate.dart][] sample,
which shows how to spawn a long-running isolate
Expand Down
8 changes: 4 additions & 4 deletions src/language/type-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ Here are some of the less obvious rules:
Let's see these rules in detail, with examples that use the following
type hierarchy:

<img src="images/type-hierarchy.png" alt="a hierarchy of animals where the supertype is Animal and the subtypes are Alligator, Cat, and HoneyBadger. Cat has the subtypes of Lion and MaineCoon">
<img src="/assets/img/language/type-hierarchy.png" alt="a hierarchy of animals where the supertype is Animal and the subtypes are Alligator, Cat, and HoneyBadger. Cat has the subtypes of Lion and MaineCoon">

<a name="use-proper-return-types"></a>
### Use sound return types when overriding methods
Expand Down Expand Up @@ -398,7 +398,7 @@ or a producer.

Consider the following type hierarchy:

<img src="images/type-hierarchy.png" alt="a hierarchy of animals where the supertype is Animal and the subtypes are Alligator, Cat, and HoneyBadger. Cat has the subtypes of Lion and MaineCoon">
<img src="/assets/img/language/type-hierarchy.png" alt="a hierarchy of animals where the supertype is Animal and the subtypes are Alligator, Cat, and HoneyBadger. Cat has the subtypes of Lion and MaineCoon">

Consider the following simple assignment where `Cat c` is a _consumer_
and `Cat()` is a _producer_:
Expand Down Expand Up @@ -445,7 +445,7 @@ Are the rules the same for generic types? Yes. Consider the hierarchy
of lists of animals—a `List` of `Cat` is a subtype of a `List` of
`Animal`, and a supertype of a `List` of `MaineCoon`:

<img src="images/type-hierarchy-generics.png" alt="List<Animal> -> List<Cat> -> List<MaineCoon>">
<img src="/assets/img/language/type-hierarchy-generics.png" alt="List<Animal> -> List<Cat> -> List<MaineCoon>">

In the following example,
you can assign a `MaineCoon` list to `myCats`
Expand Down Expand Up @@ -489,7 +489,7 @@ depending on the actual type of the list being cast (`myAnimals`).
When overriding a method, the producer and consumer rules still apply.
For example:

<img src="images/consumer-producer-methods.png" alt="Animal class showing the chase method as the consumer and the parent getter as the producer">
<img src="/assets/img/language/consumer-producer-methods.png" alt="Animal class showing the chase method as the consumer and the parent getter as the producer">

For a consumer (such as the `chase(Animal)` method), you can replace
the parameter type with a supertype. For a producer (such as
Expand Down

0 comments on commit b8e5f5b

Please sign in to comment.