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

Binding json data into a lazy loaded template #11

Open
joeblew99 opened this issue Aug 3, 2016 · 4 comments
Open

Binding json data into a lazy loaded template #11

joeblew99 opened this issue Aug 3, 2016 · 4 comments

Comments

@joeblew99
Copy link

This is some seriously good stuff.
Thanks for writing this !!

I have a use case question - not a feature request.

The user has lots of templates. Let's say they are in markdown and it represents email templates.

The user also has a json schema and json datasets that conforms to that json schema.

With juicy, I think I can build a way for the user to put special tags in the template and for the user to map json data to the tags.
And show the result of the data binding.

The key point is that juicy becomes an IDE of sorts because everything is dynamic.

I actually want to do the data bind on the server in golang. But I want to make it easy for the user to visually edit markup and configure the data mapping of the json to the tags inside the template.

Your components look to be made to do this type of thing or am a madman ? :)

@tomalec
Copy link
Member

tomalec commented Aug 31, 2016

Thanks for the kind words @joeblew99 !

Well.. more or less that's our main use case :) The only difference is that we use PuppetJS (precisely <puppet-polymer-client>) to have three-way (browser html - browser json - server json) data binding with (Starcounter) server.

Briefly:

  • Starcounter serves the JSON view-model (as well as static HTML),
  • PuppetJS (& <puppet-polymer-client>) keeps JSON in sync via JSON Patches and WebSocket/HTTP, so we can change it as it would be local one,
  • we load some partials/templates using imported-template, which also keeps data-binding working and let HTML Import spec control the dependencies and scripts execution,
  • to inspect/debug/mock/prototype data manipulation we use <juicy-jsoneditor>
  • to edit partials - in admin mode, but with instant live preview with data binding on - we use <juicy-ace-editor>
  • we also use Shadow DOM styling of vendor content and (custom) elements by <juicy-composition> - If the partial/template comes from 3rd party, or many parties, we are able to style it without breaking DOM structure, bindings, and other functionalities of custom elements and scripts there.

For more info, take a look at:

I plan to write small article on creating partials Web Components - way. Hopefully I'll find some time to make it in September. For sure you will find it at http://starcounter.io/blog/ and https://twitter.com/tomalecpl

If you have any other ideas or questions feel free to ask.

ps. Sorry for the late response, I have just came from vacations 🌴

@joeblew99
Copy link
Author

wow this is a nice surprise. I see how this gets rid of lots of glue code for applications.

Really good work.

I am thinking about using this, but i read that starcounter is windows only because its c#, so its windows only ?

@tomalec
Copy link
Member

tomalec commented Aug 31, 2016

Thanks.

Want one? ;)
image

Linux version is currently under development, I cannot give any exact date, but it should come soon.
C# is not longer windows only, you can even install Visual Studio cross-platform.

@joeblew99
Copy link
Author

joeblew99 commented Aug 31, 2016

If starcounter is c# that is cross compiled then i would be interested in it running on OSX, IOS and android. Not joking.
I tried cross compiling c# maybe 1 year ago and was not really ready yet felt, but i guess things have moved on ?

Can you run Visual Studio on OSX now ? I use VSCOde on OSX at the moment

@warpech warpech added this to the Juicy elements support milestone Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants