-
Notifications
You must be signed in to change notification settings - Fork 77
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
First key in object handled differently (in openobject
event rather than key
event)
#47
Comments
It is definitely something which I’d love to see changed in a major version. But the change as you described it might be too dangerous for even a major bump. One safer, though more complicated and ugly, approach is to keep the existing events for backwards compatibility and add an |
I'm inclined to blame the package consumer if they've configured their dependencies to automatically update to newer major versions. I'm also not overly keen on adding significant complexity to support configurability, which then must rely on compiler optimizations to (hopefully) recover branch/jump performance costs added. On the other hand, if no other changes are made in a major version bump, then the version number is the configuration parameter. 😛 I like the idea of new event names, but wouldn't want to introduce a legacy of awkward event naming because some time in the past the "right" or intuitive names were linked to deprecated behavior. |
Makes more sense. Sounds good to me. |
This is definitely driving me insane... I would expect OpenObject -> KeyName -> OpenOjbect /OpenArray/Value |
And maybe an option to control the behavior with the default to be the current behavior for some defined period (to give people a chance to change code), and the at some point switch to the new behavior by default with the option being used to switch to the old behavior. |
What is the status of this issue? |
I decided to fork clarinet into 'bass-clarinet' to solve this issue. |
As previously reported with a documentation clarification (see #46).
It seems to me that API usability would be improved by eliminating this special case, such that
openobject
only signifies the start of an object andkey
events be raised exactly once for every key without exceptions, starting in av1.0
release (simultaneously committing to full and meaningful semver compliance). However I would appreciate feedback from @dscape as well as current maintainers of other dependent public packages.Alternatively it might be nice to offer some more detailed usage guidance including coverage of edge cases. Here's an excerpt from a module I wrote—using clarinet and convertings its output to a top-level object/array stream—where I internally capture and normalize the current behavior:
The text was updated successfully, but these errors were encountered: