Skip to content

breaking change in v4.1.12 #1476

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

Closed
3 tasks done
djgilcrease opened this issue Jan 10, 2020 · 3 comments
Closed
3 tasks done

breaking change in v4.1.12 #1476

djgilcrease opened this issue Jan 10, 2020 · 3 comments
Labels

Comments

@djgilcrease
Copy link

djgilcrease commented Jan 10, 2020

Issue Description

The commit to allow setting the logger on the context 5c7c87d is a breaking change for anyone implementing the context interface

Not a huge issue to deal with in my case, but something to think about when exposing public interfaces, any change to them becomes a breaking change for others implementing them.

Checklist

  • Dependencies installed
  • No typos
  • Searched existing issues and docs

Expected behavior

interfaces to not change without a major version bump

Actual behavior

interface changed in a patch version bump

@lammel
Copy link
Contributor

lammel commented Feb 9, 2020

PR #1502 would also introduce a "breaking" change for the context interface.
So that would require to mark this PR as a breaking change and wait for release of Echo v5 (which will probably take a long while).

We decided to not implement the context interface, but rather created our own AppContext that will be cast the context into an AppContext when needed. Actually our reason to do so, was to integrate zerolog, so it pretty much is which this issue is about.

For this change I would suspect it is already to late to roll it back.

@djgilcrease
Copy link
Author

djgilcrease commented Feb 9, 2020

I agree, to late to rollback in this case, but what you can and IMHO should do is make new interfaces that also include the base Context. In this case it would be a LoggingContext that just had the method to get/set the logger. In your case it might be a RouteDetailsContext or some such.

If you keep the base Context small and focused to the basic flow needed by echo itself, then it is easy to add additional interfaces for specific methods inside echo that need to change the logger, or fetch the matched route, etc. Then people who do not need to use those methods do not need to implement the interface for their Context.

@stale
Copy link

stale bot commented Apr 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 12, 2020
@stale stale bot closed this as completed Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants