Closed nathan-muir closed 8 years ago
+1 thanks @nathan-muir
+1 thanks @nathan-muir
+1
+1, please merge
+1, can we get a merge please?
Ok, this has now bitten me. I guess I can merge and release this ;)
@nathan-muir I wonder, would it be less of a change to just remove this line: https://github.com/nathan-muir/iron-middleware-stack/blob/remove-names-from-stack/lib/handler.js#L49-L50
That way you can still name handlers, it'll just not "auto-name" them..
That's weird I was literally about to ping you in here when your comment appeared @tmeasday :smile:
@dburles @tmeasday Yeah, that would work too - I just thought, get rid of the unused apis!
I mean.. people could be using them, right?
https://github.com/iron-meteor/iron-router/issues/1513
I can't find any code in iron-router that even uses any of the name-related API's. (findByName, insertBefore and insertAfter). So there are really two options:
- Add some option / flag / type that bypasses names in MiddlewareStack. (Maintaining existing API's if someone is using it?)
- Just remove anything name related from MiddlewareStack, and bump a major version.
Am I misunderstanding something though -- like if we literally just remove those two lines of code, it will solve the problem, not change the APIs. Potentially people are relying on the behavior (of naming things from function names) but a) I doubt it b) it'd break in the end anyway, because this issue.
I think we could do that an bump a minor version?
That's definitely the less aggressive option, especially if you think there is anyone using this outside iron:router
.
I'm just advocating making the codebase leaner, leaving less places for bugs like this to pop up in future.
But yeah, I don't really mind whatever change gets made. I'm not the maintainer here.
Alright, appreciate that @nathan-muir. I think minimal changes are good given I'm pretty unfamiliar with the code base these days.
https://github.com/iron-meteor/iron-router/issues/1513
I can't find any code in
iron-router
that even uses any of the name-related API's. (findByName
,insertBefore
andinsertAfter
).But it is causing unusual breakages because names are auto-assigned based on the function name.