Repository: phoenixframework/phoenix
Pull request #3850 (2020-05-16 12:41:36)

heroku.md: Setup -> set up
"setup" is the noun and "set up" is the (phrasal) verb.

E.g. "I will set up the setup."


Patch:
diff --git a/guides/deployment/heroku.md b/guides/deployment/heroku.md
index 9eeba9634..307782649 100644
--- a/guides/deployment/heroku.md
+++ b/guides/deployment/heroku.md
@@ -35,7 +35,7 @@ Let's separate this process into a few steps so we can keep track of where we ar
 - Initialize Git repository
 - Sign up for Heroku
 - Install the Heroku Toolbelt
-- Create and setup Heroku application
+- Create and set up Heroku application
 - Make our project ready for Heroku
 - Deploy time!
 - Useful Heroku commands
@@ -68,9 +68,9 @@ Once we have signed up, we can download the correct version of the Heroku Toolbe
 
 The Heroku CLI, part of the Toolbelt, is useful to create Heroku applications, list currently running dynos for an existing application, tail logs or run one-off commands (mix tasks for instance).
 
-## Create and Setup Heroku Application
+## Create and Set Up Heroku Application
 
-There are two different ways to deploy a Phoenix app on Heroku. We could use Heroku buildpacks or their container stack. The difference between these two approaches is in how we tell Heroku to treat our build. In buildpack case, we need to update our apps configuration on Heroku to use Phoenix/Elixir specific buildpacks. On container approach, we have more control on how we want to setup our app and we can define our container image using `Dockerfile` and `heroku.yml`. This section will explore the buildpack approach. In order to use Dockerfile, it is often recommended to convert our app to use releases, which we will describe later on.
+There are two different ways to deploy a Phoenix app on Heroku. We could use Heroku buildpacks or their container stack. The difference between these two approaches is in how we tell Heroku to treat our build. In buildpack case, we need to update our apps configuration on Heroku to use Phoenix/Elixir specific buildpacks. On container approach, we have more control on how we want to set up our app and we can define our container image using `Dockerfile` and `heroku.yml`. This section will explore the buildpack approach. In order to use Dockerfile, it is often recommended to convert our app to use releases, which we will describe later on.
 
 ### Create Application
 
@@ -350,11 +350,11 @@ build:
     DATABASE_URL: $DATABASE_URL
 ```
 
-### Setup releases and Dockerfile
+### Set up releases and Dockerfile
 
 Now we need to define a `Dockerfile` at the root folder of your project that contains your application. We recommend to use releases when doing so, as the release will allow us to build a container with only the parts of Erlang and Elixir we actually use. Follow [the releases docs](releases.html). At the end of the guide, there is a sample Dockerfile file you can use.
 
-Once you have the image definition setup, you can push your app to heroku and you can see it starts building the image and deploy it.
+Once you have the image definition set up, you can push your app to heroku and you can see it starts building the image and deploy it.
 
 ## Useful Heroku Commands
 
diff --git a/guides/request_lifecycle.md b/guides/request_lifecycle.md
index efd419343..cbef6f3ca 100644
--- a/guides/request_lifecycle.md
+++ b/guides/request_lifecycle.md
@@ -8,7 +8,7 @@ Let's get on with our first new Phoenix page!
 
 ## Adding a new page
 
-When your browser accesses [http://localhost:4000/](http://localhost:4000/), it sends a HTTP request to whatever service is running on that address, in this our Phoenix application. The HTTP request is made of a verb and a path. For example, the following browser requests translate into:
+When your browser accesses [http://localhost:4000/](http://localhost:4000/), it sends a HTTP request to whatever service is running on that address, in this case our Phoenix application. The HTTP request is made of a verb and a path. For example, the following browser requests translate into:
 
 | Browser address bar                | Verb | Path          |
 |:-----------------------------------|:-----|:--------------|
diff --git a/lib/phoenix/digester.ex b/lib/phoenix/digester.ex
index 2c90453aa..26c898e7d 100644
--- a/lib/phoenix/digester.ex
+++ b/lib/phoenix/digester.ex
@@ -119,7 +119,7 @@ defmodule Phoenix.Digester do
 
   defp compiled_file?(file_path) do
     Regex.match?(@digested_file_regex, Path.basename(file_path)) ||
-      Path.extname(file_path) == ".gz" ||
+      Path.extname(file_path) in ~w(.gz .br) ||
       Path.basename(file_path) == "cache_manifest.json"
   end
 


Test patch:
diff --git a/test/fixtures/digest/priv/static/precompressed.js.br b/test/fixtures/digest/priv/static/precompressed.js.br
new file mode 100644
index 000000000..5a090955f
--- /dev/null
+++ b/test/fixtures/digest/priv/static/precompressed.js.br
@@ -0,0 +1,1 @@
+Brotli
diff --git a/test/fixtures/digest/priv/static/precompressed.js.gz b/test/fixtures/digest/priv/static/precompressed.js.gz
new file mode 100644
index 000000000..d234d64b1
--- /dev/null
+++ b/test/fixtures/digest/priv/static/precompressed.js.gz
@@ -0,0 +1,1 @@
+gzip
diff --git a/test/phoenix/digester_test.exs b/test/phoenix/digester_test.exs
index 03b25c2ab..37df1b8d6 100644
--- a/test/phoenix/digester_test.exs
+++ b/test/phoenix/digester_test.exs
@@ -84,6 +84,19 @@ defmodule Phoenix.DigesterTest do
                "93pY5dBa8nHHi0Zfj75O/vXCBXb+UvEVCyU7Yd3pzOJ7o1wkYBWbvs3pVXhBChEmo8MDANT11vsggo2+bnYqoQ=="
     end
 
+    test "excludes compiled files" do
+      input_path = "test/fixtures/digest/priv/static/"
+      assert :ok = Phoenix.Digester.compile(input_path, @output_path)
+      output_files = assets_files(@output_path)
+
+      json = Path.join(@output_path, "cache_manifest.json") |> json_read!()
+      refute json["latest"]["precompressed.js.gz"]
+      refute json["latest"]["precompressed.js.br"]
+
+      assert :ok = Phoenix.Digester.compile(@output_path, @output_path)
+      assert output_files == assets_files(@output_path)
+    end
+
     test "old versions maintain their mtime" do
       source_path = "test/fixtures/digest/priv/static/"
       input_path = "tmp/digest/static"