-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable web console logger for new projects #5910
Conversation
Thank you, @ponychicken! I think we'll need to add
config :my_app, MyAppWeb.Endpoint,
live_reload: [
+ web_console_logger: true,
patterns: [
~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
~r"priv/gettext/.*(po)$",
~r"lib/my_app_web/(controllers|live|components)/.*(ex|heex)$"
]
] |
@SteffenDE I pushed it. |
// connect if there are any LiveViews on the page | ||
<%= @live_comment %>liveSocket.connect() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we also need to enable the "click to open" component thingy? Or is that enabled by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using this branch, i cd installer
and ran mix phx.new dev_app --dev
After installing deps, adding a live view and starting the server i am able to see the web console logs without additional steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I meant to say that there are more features we should add by default. Mostly a reminder to @chrismccord :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not enabled by default, but we can accept a separate PR for it.
https://github.com/phoenixframework/phoenix_live_reload#jumping-to-heex-function-definitions
Thank you! 🙌 |
This reverts commit f586988.
You had to revert it? Any particular reason? |
I didn't see #5799 which also added a comment for the click to open functionality, so I went with that one instead. |
Should we have it enabled by default in dev? |
It is probably the better developer experience, so yeah, I think I'd be happy with doing it by default. I can send a PR :) |
Relates to: #5799 Relates to: #5910 Co-authored-by: Rodolfo Carvalho <[email protected]> Co-authored-by: ponychicken <[email protected]>
Relates to: #5799 Relates to: #5910 Co-authored-by: Rodolfo Carvalho <[email protected]> Co-authored-by: ponychicken <[email protected]>
This article describes a new and useful feature in Live reload 1.5 and later.
I think it could make sense to enable it by default for new projects...
https://fly.io/phoenix-files/phoenix-dev-blog-server-logs-in-the-browser-console/