We can't find the internet
Attempting to reconnect
Something went wrong!
Hang in there while we get back on track
phoenix changelog
Welcome to our latest update! We've been busy making some fantastic improvements and squashing bugs to enhance your development experience. Here's a look at what's new and improved:
-
New feature: Customizing primary key names is now a breeze! 🎉 You can specify an alternative name for the primary key column when generating schemas and migrations, thanks to the new
--primary-key
option. This gives you more flexibility in naming your primary keys and improves the usability of schema generation. -
Improvement: We've made it easier to enable new Phoenix Live Reload features by adding commented-out JavaScript code in the development environment. Now, streaming server logs to the browser console and clicking on components to jump directly to their code definitions is just a few clicks away. 🚀
-
Improvement: Autocomplete attributes have been added to password and username fields across various templates. This enhancement allows browsers to automatically fill in saved credentials, making login and registration processes smoother and faster. 💾
-
Improvement: The default gzip setting in the generated endpoint now considers code reloading status. Compressed static files will be served efficiently in production environments, improving performance. ⚡
-
New feature: Introducing the web console logger for new projects! This feature streams server logs directly to the client, enhancing debugging and development efficiency. It's also available for umbrella projects, thanks to collaborative efforts with José Valim. 🖥️
-
Bugfix: We fixed a potential race condition by ensuring endpoint configuration is fully initialized before the socket listener starts. This prevents crashes from incoming requests during the configuration setup, enhancing stability and reliability. 🛠️
-
Bugfix: We reverted a previous change related to the web console logger for new projects in favor of an alternative solution. This simplifies the setup for new projects, aligning with the more effective approach. 🔄
-
Bugfix: The "scrollbar-gutter" class has been removed from the HTML template, setting the scrollbar-gutter to "auto." This resolves an issue with scrollbar handling in the user interface. 🖼️
We hope these updates make your development journey smoother and more enjoyable. Happy coding! 🎈
Included Commits
This commit introduces the web console logger functionality for newly created projects, enhancing the development experience by enabling server log streaming directly to the client. The changes include modifications to the app.js
file within the installer/templates/phx_assets
directory, where a new event listener is added to facilitate this logging feature. This allows developers to view server logs in real-time while working on their applications.
Additionally, the commit extends the web console logger functionality to umbrella projects, ensuring that this feature is available across different project structures. The implementation includes a co-authorship credit to José Valim, highlighting collaboration in this enhancement. Overall, these changes aim to improve debugging and development efficiency by providing immediate access to server logs in the web console.
Files changed
- installer/templates/phx_assets/app.js
This commit reverts a previous change that enabled the web console logger for new projects in the Phoenix framework. The original commit aimed to enhance server log streaming to the client by adding event listeners for live reloading, which would allow developers to see server logs directly in the client-side console. However, the author of the revert noted that they overlooked an alternative solution proposed in another pull request (#5799) and decided to adopt that instead.
The changes made in this revert include modifications to the app.js
file, where the event listeners related to server log streaming were removed, and a single line in the dev.exs
configuration file, which disabled the web console logger feature. Overall, this commit simplifies the setup for new projects by removing the previously introduced logging functionality and aligning with the alternative solution.
Files changed
- installer/templates/phx_assets/app.js
- installer/templates/phx_umbrella/apps/app_name_web/config/dev.exs
This commit enhances the usability of the Phoenix Live Reload features by adding commented-out JavaScript code to the development environment, which allows developers to easily enable two valuable features: streaming server logs to the browser console and the ability to click on components to jump directly to their definitions in the code editor. This addition aims to make these features more discoverable for new applications, thereby improving the overall development experience.
In addition to the JavaScript changes, the commit also modifies the configuration files for development environments to include a setting that enables the logging of web console messages, further supporting the new functionalities. The changes are designed to streamline the development process by making it easier for developers to access relevant logs and navigate their codebase effectively, fostering a more efficient workflow.
Files changed
- installer/templates/phx_assets/app.js
- installer/templates/phx_single/config/dev.exs
- installer/templates/phx_umbrella/apps/app_name_web/config/dev.exs
This commit modifies the default setting for the gzip flag in the generated endpoint of a Phoenix application to account for the status of code reloading. Specifically, it sets the gzip option to true when code reloading is disabled, which typically occurs in production environments. This change ensures that compressed static files, generated by the phx.digest
command, are served efficiently when the application is deployed.
The update involves changes to the endpoint.ex
file, where the gzip setting was adjusted from a hardcoded false to a dynamic setting based on the code reloading state. This enhancement addresses an issue reported in the Phoenix framework repository, ultimately improving the performance of static file serving in production scenarios.
Files changed
- installer/templates/phx_web/endpoint.ex
This commit introduces autocomplete attributes to various password and username fields across multiple templates in the project, enhancing user experience by allowing browsers to automatically fill these fields with previously saved credentials. Specifically, the autocomplete
attribute is set to "username" for email fields and "current-password" or "new-password" for password fields, depending on the context. This change aims to streamline the login, registration, and password recovery processes by reducing the amount of manual input required from users.
In addition to adding the autocomplete functionality, the commit includes minor formatting fixes and reverts a previous commit. It modifies several template files related to authentication, including those for login, registration, password reset, and confirmation instructions, ensuring that all relevant fields are equipped with the appropriate autocomplete settings. The commit was co-authored by Steffen Deusch, indicating collaborative efforts in enhancing the project's functionality.
Files changed
- priv/templates/phx.gen.auth/confirmation_instructions_live.ex
- priv/templates/phx.gen.auth/confirmation_new.html.heex
- priv/templates/phx.gen.auth/forgot_password_live.ex
- priv/templates/phx.gen.auth/login_live.ex
- priv/templates/phx.gen.auth/registration_live.ex
- priv/templates/phx.gen.auth/registration_new.html.heex
- priv/templates/phx.gen.auth/reset_password_edit.html.heex
- priv/templates/phx.gen.auth/reset_password_live.ex
- priv/templates/phx.gen.auth/reset_password_new.html.heex
- priv/templates/phx.gen.auth/session_new.html.heex
- priv/templates/phx.gen.auth/settings_edit.html.heex
- priv/templates/phx.gen.auth/settings_live.ex
This commit introduces a modification to the HTML template in the Phoenix framework by removing the "scrollbar-gutter" class from the <html>
tag, effectively setting the scrollbar-gutter to "auto." This change addresses an issue documented in GitHub issue #5656, which likely pertains to the handling of scrollbars in the user interface.
The commit includes a single addition and deletion within the root.html.heex
file, simplifying the HTML structure. The change is co-authored by a contributor named Dinesh, indicating collaborative development efforts in refining the framework's layout components.
Files changed
- installer/templates/phx_web/components/layouts/root.html.heex
This commit introduces the ability to customize the primary key name in the Phoenix framework's context and schema generation tasks. Specifically, it adds a new option, --primary-key
, which allows developers to specify an alternative name for the primary key column when generating schemas and migrations. The changes are reflected in various files, including phx.gen.context.ex
and phx.gen.schema.ex
, where the new option is integrated into the existing command structure. The commit also updates relevant templates and test cases to ensure that the new functionality is properly supported and tested.
Additionally, the commit includes modifications to the associated test files to verify that the primary key customization works as intended. For instance, it checks that the generated migration files and schema definitions correctly reflect the specified primary key name. This enhancement not only adds flexibility for developers in naming their primary keys but also improves the overall usability of the schema generation process in Phoenix applications. The commit closes issue #5766 and is co-authored by Serge Aleynikov.
Files changed
- lib/mix/tasks/phx.gen.context.ex
- lib/mix/tasks/phx.gen.schema.ex
- priv/templates/phx.gen.context/test_cases.exs
- priv/templates/phx.gen.live/index.ex
- priv/templates/phx.gen.live/live_test.exs
- priv/templates/phx.gen.live/show.ex
- priv/templates/phx.gen.schema/migration.exs
- priv/templates/phx.gen.schema/schema.ex
- test/mix/tasks/phx.gen.schema_test.exs
This commit addresses a potential race condition in the Phoenix framework by ensuring that the endpoint configuration is fully initialized before the socket listener starts. Previously, there was a risk that incoming requests could lead to a crash if they were received during the brief window between starting the socket listener and setting the configuration in persistent_term
. The solution implemented involves invoking the warmup function as a child process in the endpoint supervisor, which guarantees that the configuration is properly set before the socket listener begins accepting connections.
In terms of code changes, the commit modifies the Phoenix.Endpoint.Supervisor
module to include a new warmup_children
function that adds the warmup process to the supervision tree. This adjustment ensures that the warmup process is executed in sequence with the other child processes, thereby preventing any timing issues that could disrupt service. The commit effectively resolves the issue reported in GitHub issue #5981, enhancing the stability and reliability of the socket handling in the Phoenix framework.
Files changed
- lib/phoenix/endpoint/supervisor.ex