-
Notifications
You must be signed in to change notification settings - Fork 393
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
refactor(engine): remove Event instanceof check on dispatchEvent #1648
Conversation
Discussion with @caridy:
|
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.
few changes needed
56ea794
to
300ccf6
Compare
if (!isNull(event) && isObject(event)) { | ||
const { type } = event; | ||
|
||
if (isString(type) && !/^[a-z][a-z0-9_]*$/.test(type)) { |
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 think this condition is incorrect, type should be a string, and a valid one, otherwise throw.
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 minor detail on the restriction condition.
d67745f
to
bca5822
Compare
@caridy Ready for another pass of review. |
Details
In the process of implementing SSR (#910), to start decoupling the engine from the DOM. This PR remove the
instanceof Event
check inLigthningElement.prototype.dispatchEvent
. The same check is run by the browser when invoking theEventTarget.prototype.dispatchEvent
method.Does this PR introduce breaking changes?
No, it does not introduce breaking changes.
If yes, please describe the impact and migration path for existing applications.
The PR fulfills these requirements: