-
Notifications
You must be signed in to change notification settings - Fork 26
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
View router discrete methods #81
Merged
Merged
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
…ome docs to the properties.
…base view types, trying overloaded approach to adding handlers to view router
…dlers, provide an exports type that holds both export identifiers based on view event.
Codecov Report
@@ Coverage Diff @@
## main #81 +/- ##
==========================================
+ Coverage 95.80% 96.09% +0.29%
==========================================
Files 39 41 +2
Lines 1431 1564 +133
Branches 80 87 +7
==========================================
+ Hits 1371 1503 +132
- Misses 58 59 +1
Partials 2 2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
… functions on router directly
selfcontained
approved these changes
Aug 19, 2022
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.
Nice work, thanks for doing this.
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.
API / Design
Tip of the 🎩 to @selfcontained for suggesting this API.
Things That Do Not Work
While the deno-slack-sdk compiles, userland code has a problem with the
export const { viewSubmission, viewClosed }
line; it doesn't like theviewSubmission
andviewClosed
properties, thinks they don't belong there:The above only happens when I attached handlers to theViewsRouter
object via theadd*
method(s). If I drop those, then the complaint goes away. This tells me something in the return value from the type-asserted exportedHandler duck-punchedaddSubmissionHandler
andaddClosedHandler
magic code in theViewsRouter
method is off.☝️This is fixed now - but leaving the explanation for historical purposes. We ended up adjusting how we wrap/export the
viewClosed
andviewSubmission
handlers so they're directly on theViewsRouter
class now.Things I Do Not Like
I feel like I'm duplicating a lot of code for no reason, and that by using generics and TypeScript "properly" I could avoid that. I tried very much in different ways to do this but all of them failed. This is as close as I've gotten to making this work 😓 😣 😧
Changes
enterprise
andis_enterprise_install
NOT optional; they seem to always be present, even in non-enterprise workspaces.src/functions/routers
directory tosrc/functions/interactivity
for clarityTODO
ViewsRouter()
constructor type assertion magicdocs/