Show HN: Create instantly shareable native app with a single JSON markup
jasonclient.org
jasonclient.org
I wanted a way to have an idea, turn it into a fully functional native app, and share it with the world, all in the next 5 minutes, as quick and easy as writing a blog post. That's why I built Jason.
Basically Jason lets you build a native interface to display and interact with any data format (csv, rss, html, json), any website, any API in any way you want, simply by writing a JSON markup and loading it. There's no need for compiling, building, deploying, or anything like that.
It's like a browser but instead of turning HTML into a web page, Jason turns your JSON into a native app. Everything from defining elements to styling to executing actions is described in a single JSON markup.
Please let me know what you think, or ask any questions. Thanks!
I believe something like this will kill the browser.
Declarative approaches are appealing, but lack sufficient flexibility for general use. BTW arguably, browsers are native apps configured by html/css/js.
Html templates in json is unnecessarily confusing. It's unfamiliar and untooled.
Unfortunately, json paths are inadequate for api's in general. They can't extract data from within text, combine, compute, nor use complex sequential api queries to get the data you need. You could add all this, but coding in a data format is awful, compared with a designed syntax like javascript.
Still, it is appealing to have just "one json". Maybe people can live with html in json for that. If you also design the backend (or it's an isomorphic frontend to an existing api), data extraction by path should be OK.
html templates in json: people accustomed to html have an extra layer between them and the result. It doesn't look like the result, making it that little bit more awkward to use. Tools don't know the json version of the html (e.g. editors with syntax highlighting; previewing the result; authoring tools).
Examples of extracting data: getting part of a date from a date string (or, eg date from date-time string). Also, first name out of a fullname string. Probably solve this class just with a regexp substitute function.
'Joins' are pretty common, where you get data from one part of an api (eg ID of a person), then use this to lookup other data. This could all be in a single json; or require different api calls - even between different api's.
Look, these features aren't hard to implement - and I wouldn't be surprised if you had them already. You could always accrete features as you go, like PHP did - ugly yet useful.
But my objection is that representing code in a data format (json) is very awkward to use. The worst examples are in XML (eg XSLT, ant java build system), but also applies to json.
If you can make it simple enough, for common cases, it's probably workable.
BTW have you seen jq? Gives a taste for features that end up being needed for handling json. And you could possibly just embed it, for arbitrary json processing... https://stedolan.github.io/jq/
BTW1 the role of this is not that different from early PHP - I wonder if embedding code in the template would work here too?
BTW2 Android already specifies UI's declaratively with a data format (XML), though it doesn't read api's etc, and it's IMHO awful to use.
you can use javascript expressions inside templates so everything you mentioned is possible using javascript.
Here's an example of javascript usage inside a template http://www.jasonbase.com/things/xLZ/edit
Here's an example usage of a template that iterates through a data fetched from network request http://www.jasonbase.com/things/a8b/edit
Just to be clear, this is not HTML and has nothing to do with WebView. The JSON is used to directly manipulate native elements like UIStackView, UITableView, etc. and that's the whole point. Hope this makes sense...
Yes, escape to javascript addresses my concerns.
Good!
As for open source it's not open source at the moment but it's one of the options I'm considering. I just wanted to get it in front of more people as quickly as possible so I can make better decisions based on reaction. If you're interested in how this will progress, please join the slack channel to stay in touch http://textethan.us8.list-manage.com/subscribe?u=54e23b3fe61... or you can also follow me www.twitter.com/gliechtenstein to hear about it.
CouchDB is a JSON document store so it could easily store these JSON apps. CouchDB has an embedded Javascript runtime that enables you to execute arbitrary Javascript on the server to perform queries (map/reduce) or perform transforms on JSON. For example, I can write a SHOW function that can take one of your JSON apps and invert all the colors. There's a lot of interesting use cases for this type of set up. I would love to explain more to you if you're open to these kinds of ideas.
I think HTML/JS/CSS have become too powerful which is a good thing, at least on desktops. But when we bring that power onto more specialized devices such as our smartphones it works as weakness instead of strength. For example, people may love super rich interactive websites on desktop but it becomes pretty much useless on our phones, which have small screen. But browsers still need to ship with these features because that's what they're supposed to do--follow the web standards.
I am actually working on a blog post to talk about this in more detail, probably will publish in next couple of days. Please follow me on www.twitter.com/gliechtenstein if you are interested.
As for how this was conceived, I've been working on quite a few apps last couple of years, some I released some I didn't. One of the apps I'm working on is http://www.textethan.com and I got frustrated how I have to rebuild everything whenever I had something to change, so I built everything into a markup. Then when I looked at the end result I saw something that can be potentially very powerful so I decided to extract it out into its own app. Hope this answers the question :)
I'd be a lot more interested in a project that uses AMP html to build a native app over a custom json spec.
Phonegap/Cordova has a developer app that works similarly, allowing you to hot-load code updates without forcing you to reinstall the entire app.
Thanks for bringing up Phonegap/Cordova so I can describe the difference. In case of Jason it directly accesses native elements like UIStackView, UITableView, UILabel, UIImage, etc. because I manually built everything from parser to renderer to do exactly that. You are basically remote controlling these native elements and calling native functions by scripting with JSON instead of writing objective-c code.
I feel like a lot of people on this thread thinks it's based on webkit, which is understandable since a lot of people claim to be native when they're just a native wrapper for HTML5. I think I need to clarify this point in future pitch.
2. it's JSON based, it's meant for interacting with APIs, not a website. Websites don't work well because html/js/css have evolved to become something of monstrosity--which is both good and bad.
3. It assumes session. It assumes that you will be the sole user of the app, which browsers can't do for many reasons. So it has authentication/key management system built in.
4. More coming soon: This is just a first version, I intentionally cut down on many features I could have implemented because I wanted to see what people think first. I have a couple of production apps from which I extracted Jason. For an example check out www.ethan.fm It's running on Jason.
If you are interested in staying in the loop about the android version please follow me on twitter www.twitter.com/gliechtenstein (I didn't get a chance to set up any mailing list or anything yet) Thanks!