-
Notifications
You must be signed in to change notification settings - Fork 7
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
Remove install #30
Merged
Merged
Remove install #30
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This DRYs up functionality, pulling some of the complexity out of other methods. Co-authored-by: Kate Higa <[email protected]>
This simplifies tests: testing less for side-effects. Co-authored-by: Kate Higa <[email protected]>
BREAKING CHANGE The code for handling eventlistening is very trivial, and might vary per consumer of this library. It is not core functionality, and should be left to upstream to setup. Removing this reduces the API surface area and complexity from this library as it doesn't need to concern itself with event management and keyboard shortcuts. Co-authored-by: Keith Cirkel <[email protected]>
BREAKING CHANGE This was never used upstream, so we want to remove this in the interest of simplicity. Co-authored-by: Kate Higa <[email protected]>
Without any event listeners (onCopy and keydown have been removed prior) AbortController is effectively dead code and can be removed. Co-authored-by: Keith Cirkel <[email protected]>
Now that all functions can be used independently of `install()`, and options can be passed into those methods, it makes little sense to have them in `install()`, and so it can be simplified to just providing the functionality of collecting containers. Co-authored-by: Keith Cirkel <[email protected]>
BREAKING CHANGE `install(container)` was side-effectful behavior which determined where quote containers would be. A better design for this is to have functions require a `containerSelector` to query against. This does the same thing but is slightly more idiomatic. Co-authored-by: Keith Cirkel <[email protected]>
srt32
approved these changes
Nov 3, 2021
koddsson
approved these changes
Nov 4, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Looks a lot simpler and more focused.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What?
Following from #29 this is a further refactoring that removes the event binding that we do (the
r
shortcut andcopy
event), instead opting to document those as patterns. This allows us to remove the AbortController that we added in #29 because instead we can simply delete theinstall()
method, opting for this library to be called imperatively however we want to upstream.Why?
This offers good separation of concerns: this library is mainly tasked with converting HTML to a markdown quote, and shouldn't also be concerned with event management. To quote the commits: