Skip to content

Commit

Permalink
Clarify what's optional in phx.new (#5783)
Browse files Browse the repository at this point in the history
  • Loading branch information
mayel committed May 2, 2024
1 parent ed1ab82 commit a9e4ca2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
12 changes: 9 additions & 3 deletions guides/introduction/up_and_running.md
Expand Up @@ -10,9 +10,15 @@ We can run `mix phx.new` from any directory in order to bootstrap our Phoenix ap
$ mix phx.new hello
```

> A note about [Ecto](ecto.html): Ecto allows our Phoenix application to communicate with a data store, such as PostgreSQL, MySQL, and others. If our application will not require this component we can skip this dependency by passing the `--no-ecto` flag to `mix phx.new`.
> To learn more about `mix phx.new` you can read the [Mix Tasks Guide](mix_tasks.html#phoenix-specific-mix-tasks).
> By default, `mix phx.new` includes a number of optional dependencies, for example:
>
> - [Ecto](ecto.html) for communicating with a data store, such as PostgreSQL, MySQL, and others. You can skip this with `--no-ecto`.
>
> - [Phoenix.HTML](https://hexdocs.pm/phoenix_html/Phoenix.HTML.html), [TailwindCSS](https://tailwindcss.com), and [Esbuild](https://esbuild.github.io) for HTML applications. You can skip them with the `--no-html` and `--no-assets` flags.
>
> - [Phoenix.LiveView](https://hexdocs.pm/phoenix_live_view/) for building realtime and interactive web applications. You can skip this with `--no-live`.
>
> Read the [Mix Tasks Guide](mix_tasks.html#phoenix-specific-mix-tasks) for the full list of things that can be excluded, among other options.
```console
mix phx.new hello
Expand Down
4 changes: 2 additions & 2 deletions guides/json_and_apis.md
Expand Up @@ -325,8 +325,8 @@ The output should contain the following:
track JavaScript dependencies
• --no-gettext - do not generate gettext files
• --no-html - do not generate HTML views
• --no-live - comment out LiveView socket setup in
assets/js/app.js. Automatically disabled if --no-html is given
• --no-live - comment out LiveView socket setup in your Endpoint
and assets/js/app.js. Automatically disabled if --no-html is given
• --no-mailer - do not generate Swoosh mailer files
• --no-tailwind - do not include tailwind dependencies and
assets. The generated markup will still include Tailwind CSS
Expand Down
4 changes: 2 additions & 2 deletions installer/lib/mix/tasks/phx.new.ex
Expand Up @@ -53,8 +53,8 @@ defmodule Mix.Tasks.Phx.New do
* `--no-html` - do not generate HTML views
* `--no-live` - comment out LiveView socket setup in assets/js/app.js.
Automatically disabled if --no-html is given
* `--no-live` - comment out LiveView socket setup in your Endpoint
and assets/js/app.js. Automatically disabled if --no-html is given
* `--no-mailer` - do not generate Swoosh mailer files
Expand Down

0 comments on commit a9e4ca2

Please sign in to comment.