phoenix changelog


Hey there, fabulous developers! 🎉 We've been busy bees making sure your Phoenix framework experience is smoother and more delightful than ever. Check out the awesome updates we've rolled out:

  • Improvement: We've jazzed up the login templates in the Phoenix authentication generator! Not only did we sprinkle some formatting magic, but we also made the alert section more informative and prominent. Now you can easily navigate to the mailbox page and enjoy a clearer login experience. ✨

  • Improvement: Scoped resources just got a performance boost! We've added an index to the migration files, making your database lookups faster than a cheetah on roller skates. 🛼 This change ensures your queries are zippy and efficient.

  • Improvement: Say hello to data-phx-session as the new selector for LiveView containers! This update ensures your LiveView components are stylish and functional, keeping everything neat and tidy. 🎨

  • New Feature: Want to switch up your icon game? We've got you covered! Our new asset management guide section walks you through using alternative icon libraries like Remix Icon. It's all about flexibility and customization, so you can make your app truly yours. 🖌️

  • Bugfix: We've fixed those pesky Tailwind custom variants for loading classes. Now your phx-click-loading, phx-submit-loading, and phx-change-loading classes will work like a charm, following Tailwind's best practices. 🚀

  • Bugfix: No more crashes on the :show page when receiving PubSub broadcasts! We've added a handle_info function to keep your socket steady and your app running smoothly, even when items are created, updated, or deleted in the background. 🛠️

Keep on coding and enjoy these snazzy updates! 💻✨

Included Commits

2025-04-11T09:33:34 See commit

This commit focuses on enhancing the formatting and content of the login-related templates in the Phoenix framework's authentication generator. Specifically, it modifies the login_live.ex and session_new.html.heex templates to improve the presentation of information regarding the local mail adapter. The changes include minor formatting adjustments, such as adding a space after the icon element and restructuring the layout of the login form for better spacing.

Additionally, the commit introduces a more informative alert section that not only notifies users about the local mail adapter but also provides guidance on accessing the mailbox page to view sent emails. This alert is now positioned more prominently within the layout, contributing to a clearer user experience during the login process. Overall, these updates aim to enhance the usability and aesthetic of the authentication interface.

Files changed

  • priv/templates/phx.gen.auth/login_live.ex
  • priv/templates/phx.gen.auth/session_new.html.heex
2025-04-11T10:28:10 See commit

This commit introduces an enhancement to the schema generation process by adding an index for scoped resources in the migration files. Specifically, it modifies the migration template to include a new line that creates an index for the specified scope key if a scope is defined. This change improves database performance by allowing for faster lookups on the indexed column, which is particularly beneficial for queries involving scoped resources.

Additionally, the commit updates the corresponding test file to verify that the generated migration correctly includes the new index creation line. The test checks for the presence of the index in the generated migration file, ensuring that the feature works as intended and maintains the integrity of the schema generation process. Overall, this commit enhances the functionality of the schema generator by optimizing resource management in the database.

Files changed

  • priv/templates/phx.gen.schema/migration.exs
  • test/mix/tasks/phx.gen.schema_test.exs
2025-04-13T16:32:11 See commit

The commit addresses issues related to the implementation of custom variants for loading classes in Tailwind CSS, specifically for the Phoenix framework. It modifies the app.css file, correcting the syntax for defining custom variants for phx-click-loading, phx-submit-loading, and phx-change-loading classes. The changes involve adjusting the syntax from using arrays to a more streamlined format that aligns with the Tailwind CSS documentation on adding custom styles and variants.

In total, the commit includes three additions and three deletions, resulting in a net change of six lines. This fix aims to enhance the functionality and usability of loading states in Phoenix applications, ensuring that the custom variants work as intended and adhere to the best practices outlined in the Tailwind CSS documentation.

Files changed

  • installer/templates/phx_assets/app.css
2025-04-14T09:12:48 See commit

This commit modifies the Phoenix framework's CSS files to use data-phx-session as the selector for LiveView containers instead of data-phx-root-id. This change was made to enhance the styling and functionality of LiveView components, ensuring that the wrapper divs are transparent for layout purposes. The updates were applied to both app.css and default.css, where the display property for the relevant selectors was adjusted accordingly.

The commit addresses issue #6188 on the Phoenix GitHub repository and includes a minor update in the code, with one addition and one deletion in each of the modified CSS files. By implementing this change, the commit aims to improve the overall structure and maintainability of the LiveView components within the framework.

Files changed

  • installer/templates/phx_assets/app.css
  • installer/templates/phx_static/default.css
2025-04-15T17:09:26 See commit

This commit addresses a crash issue that occurs when an open :show page receives a PubSub broadcast for items, as reported in issue #6197. The modification involves updating the show.ex template in the priv/templates/phx.gen.live directory to handle incoming messages related to item creation, updates, or deletions.

Specifically, the commit introduces a new handle_info function that listens for broadcast messages of types :created, :updated, and :deleted. When such messages are received, the function ensures that the socket remains unaffected by returning {:noreply, socket}, thereby preventing the application from crashing and improving the overall stability of the live view. This change enhances the user experience by allowing the :show page to remain functional even when updates occur in the background.

Files changed

  • priv/templates/phx.gen.live/show.ex
2025-04-17T09:36:02 See commit

This commit introduces a new section in the asset management guide that details how to utilize alternative icon libraries in Phoenix applications, addressing issue #6192. The documentation emphasizes the flexibility of using libraries such as Remix Icon instead of the default Heroicons. It outlines the necessary steps to replace Heroicons with Remix Icons, including updating the mix.exs file, modifying JavaScript files to handle icon traversal, and changing the CSS import statements. The guide also provides a code example for updating the icon rendering function to accommodate the new icon prefixes.

Additionally, the commit highlights the benefits of using alternative icon sets, such as avoiding unnecessary dependencies and ensuring that only the icons actually used are sent to the client. The approach can be adapted for other icon libraries as well, making it easier for developers to customize their applications according to their preferences. The detailed instructions and code snippets aim to simplify the transition for developers looking to implement different icon libraries in their projects.

Files changed

  • guides/asset_management.md