Skip to content

Commit

Permalink
Add networking libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
atsansone committed Feb 9, 2024
1 parent f3e3ea6 commit 84aae01
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 37 deletions.
38 changes: 18 additions & 20 deletions src/content/guides/libraries/useful-libraries.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,42 +16,40 @@ Commonly used packages fall into three groups:

## General-purpose packages

The following packages are useful for a wide range of projects.
Use these packages for a wide range of projects.

| **Package** | **Description** | **Commonly used APIs** |
|-------------|-----------------|------------------------|
|---------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [archive]({{site.pub-pkg}}/archive) | Encodes and decodes various archive and compression formats. | Archive, ArchiveFile, TarEncoder, TarDecoder, ZipEncoder, ZipDecoder |
| [characters]({{site.pub-pkg}}/characters) | String manipulation for user-perceived characters (Unicode grapheme clusters). | String.characters, Characters, CharacterRange |
| [http]({{site.pub-pkg}}/http) | A set of high-level functions and classes that make it easy to consume HTTP resources. | delete(), get(), post(), read() |
| [characters]({{site.pub-pkg}}/characters) | Manipulates strings for user-perceived characters (Unicode grapheme clusters). | String.characters, Characters, CharacterRange |
| [cronet_http]({{site.pub-pkg}}/cronet_http) | Provides access to the Android [Cronet](https://developer.android.com/guide/topics/connectivity/cronet/reference/org/chromium/net/package-summary) HTTP client. | |
| [cupertino_http]({{site.pub-pkg}}/cupertino_http) | Provides access to Apple's [Foundation URL Loading System](https://developer.apple.com/documentation/foundation/url_loading_system). | |
| [http]({{site.pub-pkg}}/http) | Provides set of high-level functions and classes to simplify consuming HTTP resources. | delete(), get(), post(), read() |
| [intl]({{site.pub-pkg}}/intl) | Internationalization and localization facilities, with support for plurals and genders, date and number formatting and parsing, and bidirectional text. | Bidi, DateFormat, MicroMoney, TextDirection |
| [json_serializable]({{site.pub-pkg}}/json_serializable) | An easy-to-use code generation package. For more information, see [JSON Support](/guides/json). | @JsonSerializable |
| [logging]({{site.pub-pkg}}/logging) | A configurable mechanism for adding message logging to your application. | LoggerHandler, Level, LogRecord |
| [mockito]({{site.pub-pkg}}/mockito) | A popular framework for mocking objects in tests. Especially useful if you are writing tests for dependency injection. Used with the [test]({{site.pub-pkg}}/test) package. | Answering, Expectation, Verification |
| [path]({{site.pub-pkg}}/path) | Common operations for manipulating different types of paths. For more information, see [Unboxing Packages: path.]({{site.news}}/2016/06/unboxing-packages-path.html) | absolute(), basename(), extension(), join(), normalize(), relative(), split() |
| [quiver]({{site.pub-pkg}}/quiver) | Utilities that make using core Dart libraries more convenient. Some of the libraries where Quiver provides additional support include async, cache, collection, core, iterables, patterns, and testing. | CountdownTimer (quiver.async); MapCache (quiver.cache); MultiMap, TreeSet (quiver.collection); EnumerateIterable (quiver.iterables); center(), compareIgnoreCase(), isWhiteSpace() (quiver.strings) |
| [shelf]({{site.pub-pkg}}/shelf) | Web server middleware for Dart. Shelf makes it easy to create and compose web servers, and parts of web servers. | Cascade, Pipeline, Request, Response, Server |
| [stack_trace]({{site.pub-pkg}}/stack_trace) | Methods for parsing, inspecting, and manipulating stack traces produced by the underlying Dart implementation. Also provides functions to produce string representations of stack traces in a more readable format than the native StackTrace implementation. For more information, see [Unboxing Packages: stack_trace.]({{site.news}}/2016/01/unboxing-packages-stacktrace.html) | Trace.current(), Trace.format(), Trace.from() |
| [test]({{site.pub-pkg}}/test) | A standard way of writing and running tests in Dart. | expect(), group(), test() |
| [yaml]({{site.pub-pkg}}/yaml) | A parser for YAML. | loadYaml(), loadYamlStream() |

| [json_serializable]({{site.pub-pkg}}/json_serializable) | Generates JSON manipulation code. To learn more, consult [JSON Support](/guides/json). | @JsonSerializable |
| [logging]({{site.pub-pkg}}/logging) | Adds message logging to your application. | LoggerHandler, Level, LogRecord |
| [mockito]({{site.pub-pkg}}/mockito) | Mocks objects in tests. Helps when you write tests for dependency injection. Use with the [test]({{site.pub-pkg}}/test) package. | Answering, Expectation, Verification |
| [path]({{site.pub-pkg}}/path) | Manipulates different types of paths. To learn more, consult [Unboxing Packages: path.]({{site.news}}/2016/06/unboxing-packages-path.html) | absolute(), basename(), extension(), join(), normalize(), relative(), split() |
| [quiver]({{site.pub-pkg}}/quiver) | Simplifies using core Dart libraries. Some of the libraries where Quiver provides additional support include async, cache, collection, core, iterables, patterns, and testing. | CountdownTimer (quiver.async); MapCache (quiver.cache); MultiMap, TreeSet (quiver.collection); EnumerateIterable (quiver.iterables); center(), compareIgnoreCase(), isWhiteSpace() (quiver.strings) |
| [shelf]({{site.pub-pkg}}/shelf) | Provides web server middleware for Dart. Shelf makes it easy to create and compose web servers, and parts of web servers. | Cascade, Pipeline, Request, Response, Server |
| [stack_trace]({{site.pub-pkg}}/stack_trace) | Parses, inspects, and manipulates stack traces that Dart produces. Also transforms stack traces into a more readable format than the native StackTrace implementation. To learn more, consult [Unboxing Packages: stack_trace.]({{site.news}}/2016/01/unboxing-packages-stacktrace.html) | Trace.current(), Trace.format(), Trace.from() |
| [test]({{site.pub-pkg}}/test) | Standardizes writing and running tests in Dart. | expect(), group(), test() |
| [yaml]({{site.pub-pkg}}/yaml) | Parses YAML markup. | loadYaml(), loadYamlStream() |
{:.table .table-striped .nowrap}


## Packages that expand on Dart core libraries {:#packages-that-correspond-to-sdk-libraries}
## Packages that expand on Dart core libraries {#packages-that-correspond-to-sdk-libraries}

Each of the following packages builds upon a [core library](/libraries),
adding functionality and filling in missing features:

| **Package** | **Description** | **Commonly used APIs** |
|-------------|-----------------|------------------------|
| [async]({{site.pub-pkg}}/async) | Expands on dart:async, adding utility classes to work with asynchronous computations. For more information, see [Unboxing Packages: async part 1]({{site.news}}/2016/03/unboxing-packages-async-part-1.html), [part 2]({{site.news}}/2016/03/unboxing-packages-async-part-2.html), and [part 3.]({{site.news}}/2016/04/unboxing-packages-async-part-3.html) | AsyncMemoizer, CancelableOperation, FutureGroup, LazyStream, Result, StreamCompleter, StreamGroup, StreamSplitter |
| [collection]({{site.pub-pkg}}/collection) | Expands on dart:collection, adding utility functions and classes to make working with collections easier. For more information, see [Unboxing Packages: collection.]({{site.news}}/2016/01/unboxing-packages-collection.html) | Equality, CanonicalizedMap, MapKeySet, MapValueSet, PriorityQueue, QueueList |
| [async]({{site.pub-pkg}}/async) | Expands on dart:async, adding utility classes to work with asynchronous computations. To learn more, consult [Unboxing Packages: async part 1]({{site.news}}/2016/03/unboxing-packages-async-part-1.html), [part 2]({{site.news}}/2016/03/unboxing-packages-async-part-2.html), and [part 3.]({{site.news}}/2016/04/unboxing-packages-async-part-3.html) | AsyncMemoizer, CancelableOperation, FutureGroup, LazyStream, Result, StreamCompleter, StreamGroup, StreamSplitter |
| [collection]({{site.pub-pkg}}/collection) | Expands on dart:collection, adding utility functions and classes to make working with collections easier. To learn more, consult [Unboxing Packages: collection.]({{site.news}}/2016/01/unboxing-packages-collection.html) | Equality, CanonicalizedMap, MapKeySet, MapValueSet, PriorityQueue, QueueList |
|[convert]({{site.pub-pkg}}/convert) | Expands on dart:convert, adding encoders and decoders for converting between different data representations. One of the data representations is _percent encoding_, also known as _URL encoding_. | HexDecoder, PercentDecoder |
|[io]({{site.pub-pkg}}/io) | Contains two libraries, ansi and io, to simplify working with files, standard streams, and processes. Use the ansi library to customize terminal output. The io library has APIs for dealing with processes, stdin, and file duplication. | copyPath(), isExecutable(), ExitCode, ProcessManager, sharedStdIn |

{:.table .table-striped .nowrap}


## Specialized packages

Here are some tips for finding packages that are more specialized,
Expand Down
47 changes: 30 additions & 17 deletions src/content/tutorials/server/httpserver.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,33 @@ prevpage:
title: Fetch data from the internet
---

Here are some resources for writing servers using Dart:

* Documentation
* [Using Google Cloud][] has information on Google Cloud products
that Dart servers can use, such as Cloud Run.
* [Using Google APIs][] points to resources to help you
use Firebase and Google client APIs from a Dart app.
* Samples
* [A simple Dart HTTP server][simple-sample]
* Uses the [`shelf`][] package.
* Also uses the [`shelf_router`][] and [`shelf_static`][] packages.
* Is deployable on Cloud Run.
* [A Dart HTTP server that uses Cloud Firestore][cloud-sample]
* Uses the Cloud Firestore features in the [`googleapis`][] package.
* Also uses the [`googleapis_auth`][], [`shelf`][], and
[`shelf_router`][] packages.
* Is deployable on Cloud Run.
Dart resources for writing HTTP servers include:

## Packages

* [cronet_http]({{site.pub-pkg}}/cronet_http)
Provides access to the Android [Cronet][] HTTP client.
* [cupertino_http]({{site.pub-pkg}}/cupertino_http)
Provides access to Apple's [Foundation URL Loading System][furl].

## Documentation

* [Using Google Cloud][] has information on Google Cloud products
that Dart servers can use, such as Cloud Run.
* [Using Google APIs][] points to resources to help you
use Firebase and Google client APIs from a Dart app.

## Samples

* [A simple Dart HTTP server][simple-sample]
* Uses the [`shelf`][] package.
* Also uses the [`shelf_router`][] and [`shelf_static`][] packages.
* Is deployable on Cloud Run.
* [A Dart HTTP server that uses Cloud Firestore][cloud-sample]
* Uses the Cloud Firestore features in the [`googleapis`][] package.
* Also uses the [`googleapis_auth`][], [`shelf`][], and
[`shelf_router`][] packages.
* Is deployable on Cloud Run.

[cloud-sample]: https://github.com/dart-lang/samples/tree/main/server/google_apis
[`googleapis`]: {{site.pub-pkg}}/googleapis
Expand All @@ -34,3 +44,6 @@ Here are some resources for writing servers using Dart:
[simple-sample]: https://github.com/dart-lang/samples/tree/main/server/simple
[Using Google APIs]: /guides/google-apis
[Using Google Cloud]: /server/google-cloud

[Cronet]: {{site.android-dev}}guide/topics/connectivity/cronet/reference/org/chromium/net/package-summary
[furl]: {{site.apple-dev}}/documentation/foundation/url_loading_system

0 comments on commit 84aae01

Please sign in to comment.