PhoenixKit.Install.BootHook (phoenix_kit v1.7.126)

Copy Markdown View Source

Wires PhoenixKit.boot/1 into the parent app's Application.start/2.

PhoenixKit.boot/1 rescans for late-loading :phoenix_kit_<x> deps and runs registered modules' migrate_legacy/0. It must be called after Supervisor.start_link/2 succeeds.

Idempotent — if PhoenixKit.boot is already present in the file, this helper is a no-op. Called from both mix phoenix_kit.install and mix phoenix_kit.update.

Standard form

Matches the canonical Phoenix generator output:

Supervisor.start_link(children, opts)

and rewrites it to:

Supervisor.start_link(children, opts) |> PhoenixKit.boot()

Non-standard shapes (custom variable names, piped form, calls wrapped in case/with) are left untouched and surface as an Igniter warning with manual-edit instructions.

Summary

Functions

add_boot_hook(igniter)

Add the PhoenixKit.boot/1 call to the parent app's Application.start/2.

Returns the igniter unchanged when:

  • The parent app has no lib/<app>/application.ex (unusual setup)
  • PhoenixKit.boot is already in the file (idempotent re-run)