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

Symbols not rendering correctly #4

Open
sancarn opened this issue Jun 24, 2018 · 3 comments
Open

Symbols not rendering correctly #4

sancarn opened this issue Jun 24, 2018 · 3 comments
Labels
bug Something isn't working

Comments

@sancarn
Copy link
Owner

sancarn commented Jun 24, 2018

This is pretty vital and is a result of numerous issues:

  • All objects are compiled to JSON before being sent to JavaScript and JSON does not support symbols.
  • Even if symbols were supported in JSON, the rendering of Objects doesn't support it. I.E. we might have to create our own HTML elements necessary for rendering Ruby objects.

Ultimately, on the onset we would either have to:

  • Use something other than JSON (maybe XML?)
  • Convert all symbols to symbol objects embedded in JSON e.g. {"__type__":"Symbol", "__name__":"SomeSymbol"}
  • We make "Ruby Hash Notation" which supports symbols directly: {"something"=>"something",:something=>"something else"}. And even then we'd need some way of integrating object properties.

Then when this is done, we would need to create some rendering system for the RHN objects.

@sancarn sancarn added the bug Something isn't working label Jun 24, 2018
@sancarn
Copy link
Owner Author

sancarn commented Jul 11, 2018

New idea is to use extendedJSON:

https://github.com/LaunchMenu/LaunchMenu/blob/master/src/core/communication/extendedJSON.js

I just need to make ruby stringify and parse commands.

@sancarn
Copy link
Owner Author

sancarn commented Apr 28, 2020

Better idea - Use RON

@sancarn
Copy link
Owner Author

sancarn commented Apr 28, 2020

Example where this breaks:

xx = {:a=>1, "a"=>3}
# Appears as though this returns {a=>3} however
xx[:a] # 1 as required
xx["a"] # 3 as required

this is mainly due to JSON encoding of results

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant