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.
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
Route/Handler TypeScript normalization #2548
Route/Handler TypeScript normalization #2548
Changes from 1 commit
3f8cf59
f6cecf2
b473736
613b2f8
d9a0263
5f5325f
5601bd1
278edae
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
I believe we want to make this required in v6.
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.
Oh, right. We had talked about how using strategies manually outside of an event handler wasn't a great idea.
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.
One follow-up from that is that I need to change a lot of the parameter signatures in the
PrecacheController
class to mark theExtendableEvent
as being required. (That's probably a good thing, since usingPrecacheController
outside of an event sounds like a recipe for disaster.)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 change also filters through to the
MatchWrapperOptions
andPutWrapperOptions
interfaces, which now need to mark theevent
as required.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.
Not sure if you want to do this as part of this PR or a separate on, but there are many cases in our code where we've had to make an event optional in a type definition due to us not making it required in handlers (e.g. here). I did a in VSCode for
event?:
, and lots of cases come up (and there are probably others where the name "event" isn't used).Also, there are cases where we're conditionally checking whether an event was passed (e.g. here), and it probably makes sense to remove those now.
How do you want to handle these?
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.
Okay, I can get those updated in this PR as well.
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.
Thanks, I went through and updated the corresponding jsdoc comments for a few that where missed (it was easier than going back and forth).