-
Notifications
You must be signed in to change notification settings - Fork 28
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
Handle DOM Events #63
Conversation
…cture is hiding its properties Dom Event (and all it sub classes) is built in a way it's internal properties are accessible when querying them directly but "hidden" when iterating its keys. With a code example it means: `Object.keys(new Event('click')) = ["isTrusted"]` So to be able to stringify/parse more than just `isTrusted` info we need to create a new object and set the properties by hand. As there is no way to iterate the properties we rely on a list of hardcoded properties.
…their own folders
~Sadly it is not fixing the issue with Addon Actions, I think it's because telejson run both in Browser and Node (and Event aren't handled on Node side). To investigate... It looks like Edit: And no it wasn't that, it was just that the Event was nested in another object, see 177b649 |
868284c
to
46c1cb8
Compare
46c1cb8
to
177b649
Compare
Released in 5.2.0 |
A workaround has been found in `telejson` to keep interesting data when serializing DOM Event/CustomEvent. For details, see storybookjs/telejson#63
Description
Dom Event (and all its subclasses) is built in a way its internal properties are accessible when querying them directly but "hidden" when iterating its keys.
With a code example it means:
Object.keys(new Event('click')) = ["isTrusted"]
So to be able to stringify/parse more than just
isTrusted
info we need to create a new object and set the properties by hand. As there is no way to iterate the properties we rely on a list of hardcoded properties.--
I also had to split the test suite to be able to have node and browser specific tests. We now have the following structure:

And the related NPM scripts:
--
Related to storybookjs/storybook#8544