gluestick-plugin-aphrodite
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -9,6 +9,6 @@ import { StyleSheet, css } from 'aphrodite'; | ||
test('Aphrodite plugin should return body, styles and rehydrate script', () => { | ||
const results = gluestickPluginAphrodite().renderMethod(element); | ||
const results = gluestickPluginAphrodite().renderMethod(element, [<link />]); | ||
expect(results.body).toContain('DIV'); | ||
expect(results.head).not.toBeNull(); | ||
expect(results.head.length).toBe(2); | ||
expect(results.additionalScript).not.toBeNull(); | ||
}); |
{"/home/ubuntu/gluestick/packages/gluestick-plugin-aphrodite/runtime.js": {"path":"/home/ubuntu/gluestick/packages/gluestick-plugin-aphrodite/runtime.js","statementMap":{"0":{"start":{"line":3,"column":15},"end":{"line":5,"column":1}},"1":{"start":{"line":4,"column":2},"end":{"line":4,"column":50}},"2":{"start":{"line":6,"column":13},"end":{"line":6,"column":27}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":3,"column":15},"end":{"line":3,"column":16}},"loc":{"start":{"line":3,"column":21},"end":{"line":5,"column":1}},"line":3}},"branchMap":{},"s":{"0":1,"1":1,"2":1},"f":{"0":1},"b":{},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"8bd5e2d080c1477c9d0d7a275eadd9114115f355"} | ||
,"/home/ubuntu/gluestick/packages/gluestick-plugin-aphrodite/server.js": {"path":"/home/ubuntu/gluestick/packages/gluestick-plugin-aphrodite/server.js","statementMap":{"0":{"start":{"line":5,"column":24},"end":{"line":18,"column":2}},"1":{"start":{"line":5,"column":31},"end":{"line":18,"column":1}},"2":{"start":{"line":7,"column":26},"end":{"line":9,"column":6}},"3":{"start":{"line":8,"column":6},"end":{"line":8,"column":34}},"4":{"start":{"line":10,"column":17},"end":{"line":10,"column":90}},"5":{"start":{"line":11,"column":22},"end":{"line":11,"column":94}},"6":{"start":{"line":12,"column":29},"end":{"line":15,"column":5}},"7":{"start":{"line":16,"column":4},"end":{"line":16,"column":50}},"8":{"start":{"line":20,"column":0},"end":{"line":20,"column":62}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":24},"end":{"line":5,"column":25}},"loc":{"start":{"line":5,"column":31},"end":{"line":18,"column":1}},"line":5},"1":{"name":"(anonymous_1)","decl":{"start":{"line":6,"column":16},"end":{"line":6,"column":17}},"loc":{"start":{"line":6,"column":26},"end":{"line":17,"column":3}},"line":6},"2":{"name":"(anonymous_2)","decl":{"start":{"line":7,"column":56},"end":{"line":7,"column":57}},"loc":{"start":{"line":7,"column":62},"end":{"line":9,"column":5}},"line":7}},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"f":{"0":1,"1":1,"2":1},"b":{},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"c99bb890b14d235618f7c7099c1221851f66dd7e"} | ||
,"/home/ubuntu/gluestick/packages/gluestick-plugin-aphrodite/server.js": {"path":"/home/ubuntu/gluestick/packages/gluestick-plugin-aphrodite/server.js","statementMap":{"0":{"start":{"line":5,"column":24},"end":{"line":21,"column":2}},"1":{"start":{"line":5,"column":31},"end":{"line":21,"column":1}},"2":{"start":{"line":7,"column":26},"end":{"line":9,"column":6}},"3":{"start":{"line":8,"column":6},"end":{"line":8,"column":34}},"4":{"start":{"line":10,"column":17},"end":{"line":13,"column":5}},"5":{"start":{"line":14,"column":22},"end":{"line":14,"column":94}},"6":{"start":{"line":15,"column":29},"end":{"line":18,"column":5}},"7":{"start":{"line":19,"column":4},"end":{"line":19,"column":50}},"8":{"start":{"line":23,"column":0},"end":{"line":23,"column":62}}},"fnMap":{"0":{"name":"(anonymous_0)","decl":{"start":{"line":5,"column":24},"end":{"line":5,"column":25}},"loc":{"start":{"line":5,"column":31},"end":{"line":21,"column":1}},"line":5},"1":{"name":"(anonymous_1)","decl":{"start":{"line":6,"column":16},"end":{"line":6,"column":17}},"loc":{"start":{"line":6,"column":37},"end":{"line":20,"column":3}},"line":6},"2":{"name":"(anonymous_2)","decl":{"start":{"line":7,"column":56},"end":{"line":7,"column":57}},"loc":{"start":{"line":7,"column":62},"end":{"line":9,"column":5}},"line":7}},"branchMap":{},"s":{"0":1,"1":1,"2":1,"3":1,"4":1,"5":1,"6":1,"7":1,"8":1},"f":{"0":1,"1":1,"2":1},"b":{},"_coverageSchema":"332fd63041d2c1bcb487cc26dd0d5f7d97098a6c","hash":"455d4a26054616a9da4ccc9300716abec4d7b0f4"} | ||
} |
{ | ||
"name": "gluestick-plugin-aphrodite", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"description": "Plugin for supporting Aphrodite in GlueStick project", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -6,7 +6,10 @@ import { StyleSheetServer } from 'aphrodite'; | ||
const aphroditePlugin = () => ({ | ||
renderMethod: (root) => { | ||
renderMethod: (root, styleTags) => { | ||
const { css, html } = StyleSheetServer.renderStatic(() => { | ||
return renderToString(root); | ||
}); | ||
const head = [<style key="aphrodite-styles" data-aphrodite>{`${css.content}`}</style>]; | ||
const head = [ | ||
...styleTags, | ||
<style key="aphrodite-styles" data-aphrodite>{`${css.content}`}</style>, | ||
]; | ||
const rehydrate = `window.renderedClassNames = ${JSON.stringify(css.renderedClassNames)};`; | ||
@@ -13,0 +16,0 @@ const additionalScript = [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169606
478