Repository: phoenixframework/phoenix
Pull request #4643 (2021-12-20 18:25:30)

Fix two tense issues in sentences.


Patch:
diff --git a/guides/asset_management.md b/guides/asset_management.md
index 82e439195..5d1252128 100644
--- a/guides/asset_management.md
+++ b/guides/asset_management.md
@@ -30,13 +30,11 @@ If you want to import JavaScript dependencies, you have two options to add them
 import "../css/app.css"
 ```
 
-However, if you want to use a CSS framework, such as SASS or Tailwind, you will need to use a separate tool. Here are some options to do so:
+However, if you want to use a CSS framework, you will need to use a separate tool. Here are some options to do so:
 
-  * You can use `esbuild` plugins (requires `npm`). See the "Esbuild plugins" section below
-
-  * If you want SASS, you can bring [standalone SASS](https://github.com/CargoSense/dart_sass) to your project, without a need for external dependencies (similar to esbuild).
+  * Use [standalone Tailwind](https://github.com/phoenixframework/tailwind) or [standalone SASS](https://github.com/CargoSense/dart_sass). Both similar to `esbuild`.
 
-  * You can bring Node.JS + `npm` to your application and install any package you want, typically working directly with their command line interface. See [this pull request on how to add Alpine + Tailwind](https://github.com/josevalim/phx_esbuild_demo/pull/3).
+  * You can use `esbuild` plugins (requires `npm`). See the "Esbuild plugins" section below
 
 Don't forget to remove the `import "../css/app.css"` from your JavaScript file when doing so.
 
diff --git a/guides/directory_structure.md b/guides/directory_structure.md
index cddea1c63..268cc1fcd 100644
--- a/guides/directory_structure.md
+++ b/guides/directory_structure.md
@@ -125,7 +125,7 @@ Finally, there is a `lib/hello_web/gettext.ex` file which provides international
 
 ## The assets directory
 
-The `assets` directory contains source files related to front-end assets, such as JavaScript and CSS. Since Phoenix v1.6, we use the [`esbuild`](https://github.com/evanw/esbuild/) to compile assets, which is managed by [`esbuild`](https://github.com/phoenixframework/esbuild) Elixir package. The integration with `esbuild` is baked into your app. The relevant config can be found in your `config/config.exs` file.
+The `assets` directory contains source files related to front-end assets, such as JavaScript and CSS. Since Phoenix v1.6, we use [`esbuild`](https://github.com/evanw/esbuild/) to compile assets, which is managed by the [`esbuild`](https://github.com/phoenixframework/esbuild) Elixir package. The integration with `esbuild` is baked into your app. The relevant config can be found in your `config/config.exs` file.
 
 Your other static assets are placed in the `priv/static` folder, where `priv/static/assets` is kept for generated assets. Everything in `priv/static` is served by the `Plug.Static` plug configured in `lib/hello_web/endpoint.ex`.  When running in dev mode (`MIX_ENV=dev`), Phoenix watches for any changes you make in the `assets` directory, and then takes care of updating your front end application in your browser as you work.
 
diff --git a/guides/plug.md b/guides/plug.md
index 682c53a92..a3dde87b9 100644
--- a/guides/plug.md
+++ b/guides/plug.md
@@ -65,7 +65,7 @@ Host: "localhost"
 Headers: [...]
 ```
 
-Our plug simply prints information from the connection. Although our initial plug is very simple, you can virtually do anything you want inside of it. To learn about all fields available in the connection and all of the functionality associated to it, see the [documentation for `Plug.Conn`](https://hexdocs.pm/plug/Plug.Conn.html).
+Our plug simply prints information from the connection. Although our initial plug is very simple, you can do virtually anything you want inside of it. To learn about all fields available in the connection and all of the functionality associated to it, see the [documentation for `Plug.Conn`](https://hexdocs.pm/plug/Plug.Conn.html).
 
 Now let's look at the other plug variant, the module plugs.
 
@@ -144,7 +144,7 @@ defmodule HelloWeb.Endpoint do
 
 The default endpoint plugs do quite a lot of work. Here they are in order:
 
-- `Plug.Static` - serves static assets. Since this plug comes before the logger, serving of static assets is not logged
+- `Plug.Static` - serves static assets. Since this plug comes before the logger, requests for static assets are not logged.
 
 - `Phoenix.LiveDashboard.RequestLogger` - sets up the _Request Logger_ for Phoenix LiveDashboard, this will allow you to have the option to either pass a query parameter to stream requests logs or to enable/disable a cookie that streams requests logs from your dashboard.
 
@@ -152,13 +152,13 @@ The default endpoint plugs do quite a lot of work. Here they are in order:
 
 - `Plug.Telemetry` - adds instrumentation points so Phoenix can log the request path, status code and request time by default.
 
-- `Plug.Parsers` - parses the request body when a known parser is available. By default, `Plug.Parsers`, parse URL-encoded, multipart and JSON (with `Jason`). The request body is left untouched when the request content-type cannot be parsed
+- `Plug.Parsers` - parses the request body when a known parser is available. By default, this plug can handle URL-encoded, multipart and JSON content (with `Jason`). The request body is left untouched if the request content-type cannot be parsed.
 
-- `Plug.MethodOverride` - converts the request method to PUT, PATCH or DELETE for POST requests with a valid `_method` parameter
+- `Plug.MethodOverride` - converts the request method to PUT, PATCH or DELETE for POST requests with a valid `_method` parameter.
 
-- `Plug.Head` - converts HEAD requests to GET requests and strips the response body
+- `Plug.Head` - converts HEAD requests to GET requests and strips the response body.
 
-- `Plug.Session` - a plug that sets up session management. Note that `fetch_session/2` must still be explicitly called before using the session as this plug just sets up how the session is fetched
+- `Plug.Session` - a plug that sets up session management. Note that `fetch_session/2` must still be explicitly called before using the session as this plug just sets up how the session is fetched.
 
 In the middle of the endpoint, there is also a conditional block:
 
diff --git a/installer/templates/phx_single/config/runtime.exs b/installer/templates/phx_single/config/runtime.exs
index b7c7ebc9d..d1ad49f85 100644
--- a/installer/templates/phx_single/config/runtime.exs
+++ b/installer/templates/phx_single/config/runtime.exs
@@ -7,7 +7,7 @@ import Config
 # any compile-time configuration in here, as it won't be applied.
 # The block below contains prod specific runtime configuration.
 
-# Start the phoenix server if environment is set and running in a  release
+# Start the phoenix server if environment is set and running in a release
 if System.get_env("PHX_SERVER") && System.get_env("RELEASE_NAME") do
   config :<%= @app_name %>, <%= @endpoint_module %>, server: true
 end
diff --git a/lib/mix/phoenix/schema.ex b/lib/mix/phoenix/schema.ex
index 4b2004b21..13bc26f35 100644
--- a/lib/mix/phoenix/schema.ex
+++ b/lib/mix/phoenix/schema.ex
@@ -303,8 +303,8 @@ defmodule Mix.Phoenix.Schema do
         :time           -> ~T[14:00:00]
         :time_usec      -> ~T[14:00:00.000000]
         :uuid           -> "7488a646-e31f-11e4-aace-600308960662"
-        :utc_datetime   -> DateTime.add(build_utc_datetime(), -@one_day_in_seconds)
-        :utc_datetime_usec -> DateTime.add(build_utc_datetime_usec(), -@one_day_in_seconds)
+        :utc_datetime   -> DateTime.add(build_utc_datetime(), -@one_day_in_seconds, :second, Calendar.UTCOnlyTimeZoneDatabase)
+        :utc_datetime_usec -> DateTime.add(build_utc_datetime_usec(), -@one_day_in_seconds, :second, Calendar.UTCOnlyTimeZoneDatabase)
         :naive_datetime -> NaiveDateTime.add(build_utc_naive_datetime(), -@one_day_in_seconds)
         :naive_datetime_usec -> NaiveDateTime.add(build_utc_naive_datetime_usec(), -@one_day_in_seconds)
         _  -> "some #{key}"
@@ -352,7 +352,6 @@ defmodule Mix.Phoenix.Schema do
   defp build_utc_naive_datetime,
     do: NaiveDateTime.truncate(build_utc_naive_datetime_usec(), :second)
 
-
   @enum_missing_value_error """
   Enum type requires at least one value
   For example:
diff --git a/lib/phoenix/token.ex b/lib/phoenix/token.ex
index 551405a6f..88c1764ce 100644
--- a/lib/phoenix/token.ex
+++ b/lib/phoenix/token.ex
@@ -105,6 +105,8 @@ defmodule Phoenix.Token do
       when generating the encryption and signing keys. Defaults to `:sha256`
     * `:signed_at` - set the timestamp of the token in seconds.
       Defaults to `System.system_time(:second)`
+    * `:max_age` - the default maximum age of the token. Defaults to
+      86400 seconds (1 day) and it may be overridden on verify/4.
 
   """
   def sign(context, salt, data, opts \\ []) when is_binary(salt) do


Test patch:
diff --git a/guides/testing/testing_controllers.md b/guides/testing/testing_controllers.md
index bc19e8571..46ba4885e 100644
--- a/guides/testing/testing_controllers.md
+++ b/guides/testing/testing_controllers.md
@@ -218,9 +218,9 @@ First of all, run this command:
 $ mix phx.gen.json News Article articles title body
 ```
 
-We choose a very similar concept to the Blog context <-> Post schema, except we are using a different name so we can study these concepts in isolation.
+We chose a very similar concept to the Blog context <-> Post schema, except we are using a different name so we can study these concepts in isolation.
 
-After you run the command above, do not forgot to follow the final steps output by the generator. Once all is done, we should run `mix test` and now have 33 passing tests:
+After you run the command above, do not forget to follow the final steps output by the generator. Once all is done, we should run `mix test` and now have 33 passing tests:
 
 ```console
 $ mix test