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

Mapping Siren to HTML / Jade #21

Open
ericelliott opened this issue Oct 28, 2013 · 11 comments
Open

Mapping Siren to HTML / Jade #21

ericelliott opened this issue Oct 28, 2013 · 11 comments

Comments

@ericelliott
Copy link
Contributor

I've been frustrated by the limitations of JSON for expressing hypermedia, so I'm experimenting with mapping Siren semantics to HTML (via Jade).

I'd love to get some feedback on this effort. I'm calling it Jiron.

@apsoto
Copy link

apsoto commented Oct 28, 2013

Might want to also check out [kiva/backbone.siren]

@kevinswiber
Copy link
Owner

Addressing your concerns:

Code on demand

I'm very interested in Code on Demand. I didn't see an example in Jiron. Do you see this as a script tag?

Style support

What does this mean to you? I have a plan to add class attributes to just about every element of Siren. I find I can use them everywhere. For me, personally, they're becoming one of the strongest features of the format. Clients would be able to key "style" off of class values.

@ericelliott
Copy link
Contributor Author

I'm very interested in Code on Demand. I didn't see an example in Jiron. Do you see this as a script tag?

Yes. Just a script that would load on the client and provide additional behaviors. Obviously, we'd need to come up with some restrictions and semantics to make it easy to hook up those behaviors to whatever UI the client choses to express. It should not just try to interact with and manipulate the host document directly.

Style support

To me, it means that it would be nice to provide a default view for browsing the API directly.

@apsoto
Copy link

apsoto commented Oct 28, 2013

I've been thinking of doing this as well to make a very simple api browser. If you make an api request, and hit it with a typical browser's Accepts, it will spit out a simple html doc with the json in a <script> and another helper js lib referenced via <script> that will dynamically render a human friendly interface.

Is that what you're trying to get at?

@ericelliott
Copy link
Contributor Author

Something like that, yes. =)

@apsoto
Copy link

apsoto commented Oct 28, 2013

Cool idea. I think (making assumptions here) that your Jiron project require's node? I think it would be most useful as a stand-alone javascript lib so any platform could use it since all you need to do is spit out some html and reference the lib, which any server platform can do.

@ericelliott
Copy link
Contributor Author

Jiron doesn't require Node, but I'm already working on a Jiron serializer for the Node siren-resource module -- which is also a cool project.

@ericelliott
Copy link
Contributor Author

I just checked - there are Ruby gems that wrap Jade for the client. A Jiron client could easily use those for the client compiler.

Also, It's easy to get Jade working stand-alone in the browser using Browserify V2's standalone mode.

@apsoto
Copy link

apsoto commented Oct 29, 2013

sounds cool. Keep pulling on that string...maybe a super simple but complete example (psuedo-api server, that spits out siren/json and jiron)

@ericelliott
Copy link
Contributor Author

Yeah, siron-resource will do that, soon. Jiron support is the next feature I want to add to it.

@pke
Copy link

pke commented Apr 16, 2018

@ericelliott Any more work done on your jiron? It looks like a tempting solution to create responses, we might try it out in a Rails backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants