Skip to content
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

Warn about real handler overwrites #424

Closed
deg opened this issue Oct 19, 2017 · 3 comments
Closed

Warn about real handler overwrites #424

deg opened this issue Oct 19, 2017 · 3 comments

Comments

@deg
Copy link
Contributor

deg commented Oct 19, 2017

I just accidentally registered two subs with the same name.

Re-frame did warn me that I was overwriting the handler, but I did not notice the warning. I use Figwheel, and I get a pile of these warning every time I save a file. I've learned to ignore them. This time, I was warned, but it was one real warning buried in many irrelevant ones.

Is there any way, even if dirty, that the tooling can play with file loading or Figwheel, or something, and give a louder warning when a sub has been defined twice in a single load. (Even if this limited to only catching duplicates that are in the same file, this would still be enough to catch most real cases -- for most developers, I'd imagine that handlers that share a namespace are usually in the same file).

@mike-thompson-day8
Copy link
Contributor

Duplicate of #204?

@danielcompton
Copy link
Contributor

This is related to #204 and #413. However at the time I wrote #413 I couldn't see an easy way to warn about "real" handler overwrites vs. figwheel reloading. I decided that because the warnings would show up when you reloaded the file, that would be enough. If/once #413 gets merged this will quiet down the console, and help you tune in better to the warnings that do show up, though this one would only show when you reloaded the app in a fresh browser window. I'd be open to further extensions to this afterwards if they weren't too complicated, but this seems like a relatively rare case with an easyish way to detect it (reload the browser).

@deg
Copy link
Contributor Author

deg commented Oct 20, 2017

Thanks. That makes sense. Feel free to close this as a duplicate.

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

No branches or pull requests

3 participants