-
-
Notifications
You must be signed in to change notification settings - Fork 1k
feat(nuxi): call nuxt listen
hook for dev
#2772
Conversation
The listen hook is useful to expose the address that the local development server is listening on, some third party modules will depend on fetching this reliably. As far as I can tell the listen hook is unused in nuxt 3 so far, this types seem to be consistent with what was there, I've just typed it.
βοΈ Deploy Preview for nuxt3-docs canceled. π¨ Explore the source changes: 230df8d π Inspect the deploy log: https://app.netlify.com/sites/nuxt3-docs/deploys/61e6a32fca88da0007a2841c |
This reverts commit 9229d80.
This looks good to me. Some context: nuxt/bridge#149. |
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.
Thanks π
listen
hook
listen
hooklisten
hook for dev
Sorry, but is this already available? I am running nuxt 3.0.0-27398533.8edd481 and in build/start listen does not get fired. |
@fabianwohlfart This PR only adds this hook in dev. |
@danielroe Is it possible at the moment to somehow hook onto the server and start a service, especially Socket.io? I have read nuxt/bridge#149 and not sure where things are or if i am just to blind to find the right resources... |
Is the Also, wouldn't it make sense to have See this discussion |
π Linked issue
nuxt/bridge#149
β Type of change
π Description
The listen hook is a feature from nuxt v2 that is typed in nuxt v3. but nothing calls it (as far as I can tell).
It's a useful hook to expose the server used for local development, giving module authors functionality to see the server address and hook into the server if needed.
Specifically a module I'm working on needs it, this is the equivalent nuxt 2 code.
π Checklist