phoenix changelog


Here's the lowdown on the latest updates, packed with improvements to make your development journey smoother and more enjoyable! πŸš€

  • Improvement: Enhanced Channel Documentation πŸ“š
    We've given the Phoenix Channel module documentation a significant upgrade! Now, it’s easier to understand the parameters and functionalities related to channel callbacks and broadcasting events. Detailed explanations have been added for the handle_in function, including insights on the topic, map payload from the client, and the Phoenix.Socket instance. Plus, we've streamlined the broadcasting section to focus on the broadcast function. This makes it a breeze to broadcast messages both from within channels and other parts of your application. Happy coding with clearer docs! ✨

  • Improvement: Channel Docs and Example Code Tweaks πŸ”§
    We've polished the channel documentation and example code by fixing a filename reference in Step 2 of the guide. The correct layout file is now root.html.heex, ensuring your user token is passed to JavaScript without a hitch. Similar updates were made in the socket.js file to keep everything aligned. This makes integrating JavaScript for user tokens in real-time channels a piece of cake!

  • Improvement: Consistent Path Helpers in Auth Templates πŸ”„
    Say goodbye to hardcoded URLs! We've updated the Phoenix authentication templates to use the ~p syntax for path helpers, replacing those pesky string literals. This change enhances the maintainability and readability of the code, bringing consistency across the board. The updates span several test files, including confirmation_live_test.exs, forgot_password_live_test.exs, login_live_test.exs, and registration_live_test.exs. Enjoy a cleaner, more consistent codebase in your authentication module! πŸŽ‰

Included Commits

2024-08-09T17:59:48 See commit

This commit focuses on enhancing the documentation for the Phoenix Channel module, specifically clarifying the parameters and functionalities related to channel callbacks and broadcasting events. Notably, it adds detailed explanations about the arguments passed to the handle_in function, which includes the topic, a map payload from the client, and the Phoenix.Socket instance. This provides users with a better understanding of how to interact with the socket and its fields.

Additionally, the commit simplifies and streamlines the broadcasting section by removing redundant examples and emphasizing the use of the broadcast function from the endpoint. It highlights the ability to broadcast messages both from within channels and from other parts of the application, thereby improving the clarity and usability of the documentation for developers working with Phoenix Channels. Overall, these changes aim to make the documentation more concise and informative, ultimately aiding developers in effectively utilizing the channel functionalities.

Files changed

  • lib/phoenix/channel.ex
2024-08-14T11:20:21 See commit

This commit addresses the inconsistency in the Phoenix authentication templates by replacing hardcoded string URLs with the ~p syntax for path helpers. Specifically, it modifies several test files related to the confirmation, forgot password, login, and registration processes, ensuring that the redirection paths use the ~p macro instead of plain string literals. This change enhances the maintainability and readability of the code by aligning with the conventions used in other parts of the application.

The updates were made in the following files: confirmation_live_test.exs, forgot_password_live_test.exs, login_live_test.exs, and registration_live_test.exs. Each file saw changes where the existing follow_redirect and get function calls were updated to utilize the ~p syntax for paths, thus improving consistency across the authentication test templates. Overall, the commit contributes to a cleaner and more consistent codebase within the authentication module of the Phoenix application.

Files changed

  • priv/templates/phx.gen.auth/confirmation_live_test.exs
  • priv/templates/phx.gen.auth/forgot_password_live_test.exs
  • priv/templates/phx.gen.auth/login_live_test.exs
  • priv/templates/phx.gen.auth/registration_live_test.exs
2024-08-14T11:28:00 See commit

The commit titled "Improve channel docs and example code (#5898)" focuses on enhancing the documentation and example code related to channel functionality in the project. Specifically, it corrects a reference in Step 2 of the guide, changing the filename from app.html.heex to root.html.heex to accurately reflect the correct layout file where the user token should be passed to JavaScript.

Additionally, similar updates were made in the example code within the socket.js file, ensuring that the comments and instructions align with the revised layout filename. These changes aim to provide clearer guidance for developers on how to implement the necessary JavaScript integration for user tokens in real-time channels.

Files changed

  • guides/real_time/channels.md
  • priv/templates/phx.gen.socket/socket.js