Skip to content
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

Add safeguards around Unknown annotations and unhandled annotations in renderers #285

Closed
2 tasks done
tim-evans opened this issue Nov 11, 2019 · 1 comment
Closed
2 tasks done
Assignees
Labels
🎉 Feature A new feature or request 🐣 Good First Issue This is a good issue for first-time contributors

Comments

@tim-evans
Copy link
Collaborator

tim-evans commented Nov 11, 2019

As per a discussion that we had here, we were finding that it's particularly annoying when unknown annotations occur, and when Rendering cases aren't handled.

Unknown annotations are created automatically by atjson, and we'd like to make this an explicit decision by the user, because often this is not intentional and causes bugs.

Sussing out what to do about this structurally will take some time, but for now, we'd like to do the following:

  • Add assertions when encountering any UnknownAnnotation in a Renderer.
  • Add warnings when a Renderer doesn't have a rendering hook for a given annotation. Having no render method for an annotation is undefined behavior by atjson, and is also different for each renderer. This logging will improve introspection for applications that use @atjson/renderer-react.

We expect that these will make the ergonomics of rendering and converting a bit easier.

@tim-evans tim-evans added 🐣 Good First Issue This is a good issue for first-time contributors 🎉 Feature A new feature or request labels Nov 11, 2019
@tim-evans
Copy link
Collaborator Author

This is fixed! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎉 Feature A new feature or request 🐣 Good First Issue This is a good issue for first-time contributors
Projects
None yet
Development

No branches or pull requests

2 participants