feat: add EventTarget to @vite/client#1
Merged
fwouts merged 1 commit intofwouts:custom-error-handlerfrom Jun 4, 2021
Merged
Conversation
Owner
|
Nice one! I'll try to test this out later this weekend. In terms of tests, I can think of a couple of approaches:
The latter could fit nicely into the existing tests in https://github.com/vitejs/vite/blob/eb66b4350c635fb4f2ef2e8a9eb50958cde73743/packages/playground/hmr/__tests__/hmr.spec.ts In terms of unit testing, I personally feel like we need to refactor and split up client.ts to make it more modular and testable first (and that should be its own PR). Otherwise, these unit tests will likely look too hacky. Would integration tests be sufficient in this instance? |
Owner
|
Yup, I can confirm this works :) I'll try and improve it further as you suggested. |
9 tasks
This file contains hidden or 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
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.
This is a suggested alternative to vitejs#3638
@fwouts && @patak-js please have a look
Also @fwouts please check this out locally and test it with
I just written the code without testing anything!!!
Please also think about adding more events.
If this is a nice solution and working, we need to improve the types / override the typedefs for the
addEventListenercall so it's not just string, but the different events + inline docs.Documentation needs also be updated.
It's also maybe possible to write tests 🤔