Skip to content

Commit 0115b68

Browse files
SteffenDEjosevalim
andauthored
add note about compilation order (#3891)
* add note about compilation order Relates to: #3883. * Apply suggestions from code review Co-authored-by: José Valim <[email protected]> --------- Co-authored-by: José Valim <[email protected]>
1 parent 4cecfad commit 0115b68

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/phoenix_live_view/colocated_hook.ex

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ defmodule Phoenix.LiveView.ColocatedHook do
5151
*/
5252
```
5353
54+
> #### Compilation order {: .info}
55+
>
56+
> Colocated hooks are only written when the corresponding component is compiled.
57+
> Therefore, whenever you need to access a colocated hook, you need to ensure
58+
> `mix compile` runs first. This automatically happens in development.
59+
>
60+
> If you have a custom mix alias, instead of
61+
> release: ["assets.deploy", "release"]
62+
> do
63+
> release: ["compile", "assets.deploy", "release"]
64+
> to ensure that all colocated hooks are extracted before esbuild or any other bundler runs.
65+
5466
## Options
5567
5668
Colocated hooks are configured through the attributes of the `<script>` tag.

0 commit comments

Comments
 (0)