@remixproject/engine-web
The web engine provides a connector for Iframe & Websocket. `npm install @remixproject/engine-web`
Last updated 11 days ago by grandschtroumpf .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @remixproject/engine-web 
SYNC missed versions from official npm registry.

Engine Web

The web engine provides a connector for Iframe & Websocket. npm install @remixproject/engine-web

Iframe

The iframe connector is used to load & connect a plugin inside an iframe. Iframe based plugin are webview using an index.html as entry point & need to use @remixproject/plugin-iframe.

const myPlugin = new IframePlugin({
  name: 'my-plugin',
  url: 'https://my-plugin-path.com',
  methods: ['getData']
})
engine.register(myPlugin);
// This will create the iframe with src="https://my-plugin-path.com"
await manager.activatePlugin('my-plugin');
const data = manager.call('my-plugin', 'getData');

Communication between the plugin & the engine uses the window.postMessage() API.

Websocket

The websocket connector wraps the native Websocket object from the Web API. Websocket based plugin are usually server with a Websocket connection open. Any library can be used, remixproject provide a wrapper around the ws library : @remixproject/plugin-ws.

const myPlugin = new WebsocketOptions({
  name: 'my-plugin',
  url: 'https://my-server.com',
  methods: ['getData']
}, {
  reconnectDelay: 5000 // Time in ms to wait to reconnect after a disconnection 
});
engine.register(myPlugin);
// This will open a connection with the server. The server must be running first.
await manager.activatePlugin('my-plugin');
const data = manager.call('my-plugin', 'getData');

Current Tags

  • 0.3.3                                ...           latest (11 days ago)
  • 0.3.3-alpha                                ...           next (11 days ago)

18 Versions

  • 0.3.3                                ...           11 days ago
  • 0.3.3-alpha                                ...           11 days ago
  • 0.3.2                                ...           18 days ago
  • 0.3.1                                ...           25 days ago
  • 0.3.0                                ...           a month ago
  • 0.3.0-beta.14                                ...           a month ago
  • 0.3.0-beta.13                                ...           2 months ago
  • 0.3.0-beta.12                                ...           2 months ago
  • 0.3.0-beta.11                                ...           2 months ago
  • 0.3.0-beta.10                                ...           2 months ago
  • 0.3.0-beta.9                                ...           2 months ago
  • 0.3.0-beta.8                                ...           2 months ago
  • 0.3.0-beta.7                                ...           2 months ago
  • 0.3.0-beta.6                                ...           2 months ago
  • 0.3.0-beta.5                                ...           3 months ago
  • 0.3.0-beta.4                                ...           3 months ago
  • 0.3.0-beta.3                                ...           3 months ago
  • 0.3.0-beta.2                                ...           3 months ago
Downloads
Today 0
This Week 4
This Month 35
Last Day 0
Last Week 14
Last Month 49
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |