import Phoenix.Component, only: [assign: 2, assign: 3]
https://hexdocs.pm/phoenix_live_view/Phoenix.Component.html#...Importing from Socket should work, but you're right, the code in the post wouldn't work. They use to be in LiveView but got moved to Component.