GithubHelp home page GithubHelp logo

Comments (4)

copongcopong avatar copongcopong commented on August 18, 2024

WebView sending "Jason" to parent app, could probably trigger new view and same flow; Doing a data messaging back and forth would need a different approach.

from documentation.

gliechtenstein avatar gliechtenstein commented on August 18, 2024

@copongcopong great point, I was thinking about just starting out with implementing actions. It's still just idea stage though. Trying to think of some critical use cases.

from documentation.

jxsp avatar jxsp commented on August 18, 2024

I will be watching this issue, as I mentioned this is pretty useful for me - but I agree that use cases should be critical, will let you know if I know some very specific ones (too late at night to think about that right now :)). Checking out the other issues now to see if there is something that I can help out with over the weekend.

from documentation.

gliechtenstein avatar gliechtenstein commented on August 18, 2024

This feature is coming soon. Just updating here with a bit of more info on how it's implemented so we can document it:


This feature allows a web container to reach outside of its own sandbox and call its parent Jasonette native app's JASON actions, simply by calling:

JASON.call(/****JASON ACTION****/)

from its javascript. You just need to pass the same action JSON as an argument. Here's an example:

{
  "type": "html",
  "text": "<html><script>var t= {name: 'cat'}; JASON.call({trigger:\"add\",options:t})</script></html>"
}

Another example:

{
  "type": "html",
  "text": "<html><script>JASON.call({type:\"$util.alert\",options:{title: 'alert', description: 'this is an alert'}})</script></html>"
}

screen shot 2017-08-07 at 11 46 55 am


This is part 1 of the full IPC architecture as it addresses only the webcontainer ==> Jasonette direction communication.

The part 2, which is the opposite direction (Jasonette ==> web container), is much more complicated and involves introduction of multiple APIs since it needs ways to describe how to:

  1. Identify each web container component with a unique identifier
  2. Keep track of all the web containers that can be messaged
  3. Dispatch a Javascript function call to only the intended web container

Part 1 is already useful for many cases and it looks like Part 2 will take some time to figure out, which is why it's broken down into two parts. The part 2 will be a separate PR.

from documentation.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.