Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@financial-times/x-engine

Package Overview
Dependencies
Maintainers
15
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@financial-times/x-engine - npm Package Compare versions

Comparing version 1.0.0-beta.1 to 1.0.0-beta.2

13

package.json
{
"name": "@financial-times/x-engine",
"version": "1.0.0-beta.1",
"description": "A consolidation library to render x- components with any compatible runtime.",
"version": "1.0.0-beta.2",
"description": "This module is a consolidation library to render x-dash components with any compatible runtime.",
"main": "src/server.js",
"browser": "src/client.js",
"keywords": [],
"keywords": [
"x-dash"
],
"author": "",

@@ -13,2 +15,7 @@ "license": "ISC",

},
"repository": {
"type": "git",
"url": "https://github.com/Financial-Times/x-dash.git"
},
"homepage": "https://github.com/Financial-Times/x-dash/tree/master/packages/x-engine",
"engines": {

@@ -15,0 +22,0 @@ "node": ">= 6.0.0"

# x-engine
A consolidation library to render `x-` components with any compatible runtime.
This module is a consolidation library to render `x-dash` components with any compatible runtime.

@@ -122,2 +122,22 @@ ## Installation

#### Client-side through n-ui
In order to configure n-ui to compile x-dash based `.jsx` files you will also need to add the following to `n-ui-build.config.js`.
```js
// n-ui-build.config.js
const xEngine = require('@financial-times/x-engine/src/webpack');
module.exports = {
plugins: [
xEngine()
],
pragma: 'h'
};
```
You will also need to import `h` from `x-engine` at the top of each `.jsx` file.
```javascript
import {h} from '@financial-times/x-engine'
```
## FAQ

@@ -124,0 +144,0 @@

@@ -9,1 +9,2 @@ /* eslint no-undef: "off", no-unused-vars: "off" */

module.exports.Component = X_ENGINE_COMPONENT;
module.exports.Fragment = X_ENGINE_FRAGMENT;

@@ -6,2 +6,3 @@ module.exports = {

component: 'Component',
fragment: 'Fragment',
renderModule: 'react-dom',

@@ -20,4 +21,5 @@ render: 'render'

component: 'Component',
fragment: 'Fragment',
render: 'render'
}
};

@@ -28,6 +28,9 @@ const deepGet = require('./concerns/deep-get');

// 7. if the rendering module is different to the runtime, load it
// 7. if we've loaded the runtime then find its Fragment object
const fragment = config.fragment ? runtime[config.fragment] : null;
// 8. if the rendering module is different to the runtime, load it
const renderModule = config.renderModule ? require(resolvePeer(config.renderModule)) : runtime;
// 8. if we've got the render module then find its render method
// 9. if we've got the render module then find its render method
const render = config.render ? renderModule[config.render] : renderModule;

@@ -38,1 +41,2 @@

module.exports.Component = component;
module.exports.Fragment = fragment;

@@ -44,2 +44,3 @@ const assignDeep = require('assign-deep');

'X_ENGINE_COMPONENT': config.component ? `runtime["${config.component}"]` : 'null',
'X_ENGINE_FRAGMENT': config.fragment ? `runtime["${config.fragment}"]` : 'null',
'X_ENGINE_RENDER_MODULE': `"${config.renderModule}"`,

@@ -46,0 +47,0 @@ 'X_ENGINE_RENDER': config.render ? `render["${config.render}"]` : 'null',

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc