@untool/react
Advanced tools
Comparing version 0.7.0 to 0.8.0
@@ -6,2 +6,10 @@ # Change Log | ||
<a name="0.8.0"></a> | ||
# [0.8.0](https://github.com/untool/untool/compare/v0.7.0...v0.8.0) (2018-06-13) | ||
**Note:** Version bump only for package @untool/react | ||
<a name="0.7.0"></a> | ||
@@ -8,0 +16,0 @@ # [0.7.0](https://github.com/untool/untool/compare/v0.4.0...v0.7.0) (2018-06-05) |
@@ -5,3 +5,3 @@ const { createElement } = require('react'); | ||
exports.withServer = function withServer(WrappedComponent) { | ||
return withRouter(props => | ||
return withRouter((props) => | ||
createElement(WrappedComponent, { | ||
@@ -8,0 +8,0 @@ ...props, |
const esc = require('serialize-javascript'); | ||
const variable = ({ name, value }) => `<script>${name}=${esc(value)}</script>`; | ||
const cssLink = css => `<link rel="stylesheet" href="/${css}" />`; | ||
const jsLink = js => `<script src="/${js}"></script>`; | ||
const cssLink = (css) => `<link rel="stylesheet" href="/${css}" />`; | ||
const jsLink = (js) => `<script src="/${js}"></script>`; | ||
module.exports = data => | ||
module.exports = (data) => | ||
`<!DOCTYPE html> | ||
@@ -9,0 +9,0 @@ <html ${data.fragments.htmlAttributes}> |
@@ -6,3 +6,6 @@ /* eslint-env browser */ | ||
const { override, async: { compose, parallel, pipe } } = require('mixinable'); | ||
const { | ||
override, | ||
async: { compose, parallel, pipe }, | ||
} = require('mixinable'); | ||
@@ -24,5 +27,6 @@ const { Mixin } = require('@untool/core'); | ||
render() { | ||
var mountpoint = document.querySelector(`#${this.config.namespace}`); | ||
var attribute = `data-${this.config.namespace}`; | ||
var isMounted = mountpoint.hasAttribute(attribute); | ||
const { name } = this.config; | ||
const mountpoint = document.querySelector(`#${name}`); | ||
const attribute = `data-${name}`; | ||
const isMounted = mountpoint.hasAttribute(attribute); | ||
if (isMounted) { | ||
@@ -36,8 +40,8 @@ unmountComponentAtNode(mountpoint); | ||
.then(() => this.enhanceElement(this.element)) | ||
.then(element => | ||
.then((element) => | ||
this.fetchData({}, element) | ||
.then(data => this.enhanceData(data)) | ||
.then((data) => this.enhanceData(data)) | ||
.then(() => element) | ||
) | ||
.then(element => (isMounted ? render : hydrate)(element, mountpoint)); | ||
.then((element) => (isMounted ? render : hydrate)(element, mountpoint)); | ||
} | ||
@@ -44,0 +48,0 @@ } |
@@ -6,3 +6,6 @@ const { createElement } = require('react'); | ||
const { override, async: { compose, parallel, pipe } } = require('mixinable'); | ||
const { | ||
override, | ||
async: { compose, parallel, pipe }, | ||
} = require('mixinable'); | ||
@@ -38,3 +41,3 @@ const { Mixin } = require('@untool/core'); | ||
...data, | ||
mountpoint: this.config.namespace, | ||
mountpoint: this.config.name, | ||
assetsByType: this.assetsByType, | ||
@@ -55,6 +58,6 @@ globals: data.globals || [], | ||
.then(() => this.enhanceElement(this.element)) | ||
.then(element => | ||
this.fetchData({}, element).then(data => ({ element, data })) | ||
.then((element) => | ||
this.fetchData({}, element).then((data) => ({ element, data })) | ||
) | ||
.then(result => { | ||
.then((result) => { | ||
const { element, data } = result; | ||
@@ -65,3 +68,3 @@ const markup = renderToString(element); | ||
.then(template) | ||
.then(document => { | ||
.then((document) => { | ||
const routerContext = this.routerContext; | ||
@@ -68,0 +71,0 @@ if (routerContext.miss) { |
{ | ||
"name": "@untool/react", | ||
"version": "0.7.0", | ||
"version": "0.8.0", | ||
"description": "untool react mixin", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@untool/core": "^0.7.0", | ||
"@untool/core": "^0.8.0", | ||
"babel-plugin-transform-react-remove-prop-types": "^0.4.13", | ||
@@ -31,0 +31,0 @@ "babel-preset-react": "^6.24.1", |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15972
220
0
+ Added@untool/core@0.8.2(transitive)
+ Addeddebug@3.2.7(transitive)
+ Addedfind-up@3.0.0(transitive)
+ Addedhas-flag@3.0.0(transitive)
+ Addedlocate-path@3.0.0(transitive)
+ Addedms@2.1.3(transitive)
+ Addedp-limit@2.3.0(transitive)
+ Addedp-locate@3.0.0(transitive)
+ Addedp-try@2.2.0(transitive)
+ Addedsupports-color@5.5.0(transitive)
- Removed@untool/core@0.7.0(transitive)
- Removedfind-up@2.1.0(transitive)
- Removedlocate-path@2.0.0(transitive)
- Removedp-limit@1.3.0(transitive)
- Removedp-locate@2.0.0(transitive)
- Removedp-try@1.0.0(transitive)
Updated@untool/core@^0.8.0