Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clarify what's optional in phx.new #5783

Merged
merged 4 commits into from
May 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 5 additions & 3 deletions guides/introduction/up_and_running.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ 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).
> A note about what's included: By default `mix phx.new` adds a number of optional libraries and generates the config and integration code needed in your application, for example:
mayel marked this conversation as resolved.
Show resolved Hide resolved
> - [Ecto](ecto.html) 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`.
> - [Phoenix.HTML](https://hexdocs.pm/phoenix_html/Phoenix.HTML.html), [TailwindCSS](https://tailwindcss.com), and [Esbuild](https://esbuild.github.io) for basic web applications, which you can exclude with `--no-html` and `--no-assets` for API-only applications.
> - [Phoenix.LiveView](https://hexdocs.pm/phoenix_live_view/) for interactive web applications, which you can exclude 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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 in your Endpoint
mayel marked this conversation as resolved.
Show resolved Hide resolved
and assets/js/app.js. Automatically disabled if --no-html is given

* `--no-mailer` - do not generate Swoosh mailer files

Expand Down