ethdebug / format

Smart contract debugging data format – Standards development working group
https://ethdebug.github.io/format/
43 stars 4 forks source link

feat(Playground) #76

Closed raxhvl closed 3 months ago

raxhvl commented 7 months ago

🪄 Summary

Closes #64 - This feature introduces an interactive playground for quick tinkering with the EthDebug schema.

🎯 Updates

📦 New Dependencies

  1. @monaco-editor/react@^4.6.0: Monaco IDE component for react.
  2. ajv@^8.12.0: Plugin for JSON schema validation.
  3. react-toastify@10.0.4: Plugin for showing floating error messages.
gnidan commented 7 months ago

Nice job with this! I just tried it out and it works better than I expected. I notice that the ethdebug/format/type playground doesn't report great error messages, but I'm hoping that maybe there's a way to improve that by changing the schema a bit. ethdebug/format/type/elementary seems to work just fine - the errors it gives are quite clear.

I did notice one issue, which is that the toast notifications are a bit wonky... they don't seem to clear properly, like check this screenshot:

Screenshot 2024-01-29 at 21 29 38

Hopefully that'll be pretty easy to sort out... not sure what the requirements should be for toast timing and whatnot, but happy to think of it if you're not sure how it should behave.

Thanks for all your work on this... I'm sure there were parts of it that were frustrating 🙏

raxhvl commented 7 months ago

Hmm.. This sparked some questions about our toast message approach:

  1. Toast vs. Inline Errors: Do we need both? Inline squiggly feedback during user input seems more intuitive. Also one less npm dependency.
  2. Missing Schema Examples: How should we handle situations where schema examples are unavailable?
  3. Standalone Playground : Should we consider adding a dedicated playground page with schema selection?

Feel free to share your detailed thoughts! We need this tool to be both accurate and user friendly.

This particular error occurs when the schema is not a valid JSON. I think this could very well be inlined.

gnidan commented 7 months ago

Hmm.. This sparked some questions about our toast message approach:

  1. Toast vs. Inline Errors: Do we need both? Inline squiggly feedback during user input seems more intuitive. Also one less npm dependency.

Yeah, maybe for simplicity, it makes sense to ditch the toast notifications.

  1. Missing Schema Examples: How should we handle situations where schema examples are unavailable?

Good question... maybe we should just require that all schemas provide examples :)

  1. Standalone Playground : Should we consider adding a dedicated playground page with schema selection?

Sounds like it's worth having one of these :)

Good thoughts!

raxhvl commented 6 months ago

Ahoy! I have made the following updates:

But... complex schemas still have verbose errors (apart from the useful ones). Could you take a look ? Not sure if this has to do with the schema itself or the AJV options.

Screenshot from 2024-02-13 13-49-48

raxhvl commented 5 months ago

Much cleaner errors: image

I have made minimal changes to the schema to get this to work.

We could:

raxhvl commented 3 months ago

@gnidan I have removed package-lock.json.