Corrects the phoenix-thinking guidance on mount/3 vs handle_params/3.
The previous "Iron Law" said queries belong in handle_params/3 instead of mount/3 to avoid duplicate queries on initial load. That rationale is wrong: handle_params/3 also runs twice on initial load (dead render + connected render), so moving queries there does not dedupe anything.
What changed:
- Default is now to load data in
mount/3.handle_params/3is for data that changes on live navigation (push_patch/<.link patch={...}>), since mount does not re-run on patches - For the actual initial double-load problem, the skill now lists the real tools with accurate descriptions:
connected?/1to gate work to the connected render,assign_async/3to defer the load, andassign_new/3to reuseconn.assignsset by upstream Plugs (it does not dedupe arbitrary mount work) - Added a small
connected?/1code example - Fixed the Red Flags entry that flagged any DB query in mount
Bumps:
- elixir plugin: 1.13.0 to 2.0.0
- marketplace: 2.0.0 to 3.0.0