You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I had someone import models/todo and ./models/todo. This caused a situation where CanJS's real-time didn't seem to work. This was because one part of the page was using one Todo export and other was using a different Todo export. It took me a while to figure this was because there were two Todo types.
I'd like to propose warning someone if a file at a path has been loaded twice.
This can be done by keeping a side table storing paths to module names. If two modules are added to this table, we should warn.
This warning would have made the problem immediately obvious.
I think there are very few reasons the same module might want to be executed twice. I remember @matthewp talking about this. I don't think these cases are common enough where a warning wouldn't be helpful for a majority of users.
The text was updated successfully, but these errors were encountered:
Today I had someone import
models/todo
and./models/todo
. This caused a situation where CanJS's real-time didn't seem to work. This was because one part of the page was using oneTodo
export and other was using a differentTodo
export. It took me a while to figure this was because there were twoTodo
types.I'd like to propose warning someone if a file at a path has been loaded twice.
This can be done by keeping a side table storing paths to module names. If two modules are added to this table, we should warn.
This warning would have made the problem immediately obvious.
I think there are very few reasons the same module might want to be executed twice. I remember @matthewp talking about this. I don't think these cases are common enough where a warning wouldn't be helpful for a majority of users.
The text was updated successfully, but these errors were encountered: