Skip to content

Conversation

LostKobrakai
Copy link
Contributor

No description provided.

@@ -1060,11 +942,11 @@ defmodule Phoenix.Endpoint do
by `Phoenix.Token`. By default tokens are valid for 2 weeks

"""
defmacro socket(path, module, opts \\ []) do
module = Macro.expand(module, %{__CALLER__ | function: {:socket_dispatch, 2}})
defmacro socket(_path, _module, _opts \\ []) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We most likely want to still support the old way as usual

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I removed stuff in here mostly to make sure I catch everything. Making this propely backwards compatibility preserving will make sense once other questions are dealt with.

Comment on lines 414 to 416
def __start_sockets__ do
unquote(Keyword.get(opts, :start_sockets, []))
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know yet if I really like having it explicit.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'm with you. On the one hand it is really nice how this used to work.

On the other hand I don't like the amount of stuff that's being configured on the endpoint socket macro. Because there's just a single entry point to "everything" that also means everything needs to somehow be configured right there.

Given routers and endpoints are really only quite loosely coupled there's afaik also no good way to retain the static knowledge of to be started socket modules from the router macro.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants