@serveside/react
Advanced tools
Comparing version 0.0.1-alpha.13 to 0.1.0-alpha.0
@@ -0,1 +1,13 @@ | ||
<!-- START doctoc generated TOC please keep comment here to allow auto update --> | ||
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> | ||
- [Change Log](#change-log) | ||
- [0.1.0-alpha.0 (2020-09-03)](#010-alpha0-2020-09-03) | ||
- [0.0.1-alpha.13 (2020-09-02)](#001-alpha13-2020-09-02) | ||
- [0.0.1-alpha.11 (2020-09-02)](#001-alpha11-2020-09-02) | ||
- [0.0.1-alpha.3 (2020-09-01)](#001-alpha3-2020-09-01) | ||
<!-- END doctoc generated TOC please keep comment here to allow auto update --> | ||
# Change Log | ||
@@ -6,2 +18,10 @@ | ||
# [0.1.0-alpha.0](https://github.com/serveside/serveside/compare/v0.0.1-alpha.14...v0.1.0-alpha.0) (2020-09-03) | ||
**Note:** Version bump only for package @serveside/react | ||
## [0.0.1-alpha.13](https://github.com/serveside/serveside/compare/v0.0.1-alpha.12...v0.0.1-alpha.13) (2020-09-02) | ||
@@ -8,0 +28,0 @@ |
"use strict"; | ||
var _server = _interopRequireDefault(require("react-dom/server")); | ||
var _index = require("./index"); | ||
@@ -7,4 +9,2 @@ | ||
var _server = _interopRequireDefault(require("react-dom/server")); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -11,0 +11,0 @@ |
{ | ||
"name": "@serveside/react", | ||
"version": "0.0.1-alpha.13", | ||
"version": "0.1.0-alpha.0", | ||
"description": "> TODO: description", | ||
@@ -8,2 +8,7 @@ "author": "Naftali Lubin <maniator@users.noreply.github.com>", | ||
"license": "MIT", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/serveside/serveside.git", | ||
"directory": "packages/react" | ||
}, | ||
"main": "dist/index.js", | ||
@@ -21,6 +26,2 @@ "publishConfig": { | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/serveside/serveside.git" | ||
}, | ||
"scripts": { | ||
@@ -37,3 +38,3 @@ "test": "echo \"Error: run tests from root\" && exit 1" | ||
}, | ||
"gitHead": "819d5c3e7de7c3a2b1d30e56ce94aa837d47a034" | ||
"gitHead": "4b97db4219f76d5f2b037c6d9b9c6eb3eb37a755" | ||
} |
import React from 'react'; | ||
import ReactDOMServer from 'react-dom/server'; | ||
import { isValidElementType } from "react-is"; | ||
import { isValidElementType } from 'react-is'; | ||
@@ -55,3 +55,5 @@ function htmlLoader(req, res, next) { | ||
__html: ` | ||
window.__SERVESIDE_LOAD_ERROR__ = ${JSON.stringify(error.message)}; | ||
window.__SERVESIDE_LOAD_ERROR__ = ${JSON.stringify( | ||
error.message, | ||
)}; | ||
window.__SERVESIDE_LOAD_PROPS__ ||= {}; | ||
@@ -58,0 +60,0 @@ window.__SERVESIDE_LOAD_PROPS__[${req.id}] = ${JSON.stringify( |
@@ -0,4 +1,4 @@ | ||
import ReactDomServer from 'react-dom/server'; | ||
import { htmlLoader, errorHtmlLoader } from './index'; | ||
import Component from '../test-helpers/component'; | ||
import ReactDomServer from 'react-dom/server'; | ||
@@ -27,3 +27,4 @@ describe('render HTML', () => { | ||
const html = ReactDomServer.renderToStaticMarkup(res.locals.jsx); | ||
expect(html.trim()).toEqual(` | ||
expect(html.trim()).toEqual( | ||
` | ||
<div data-serveside-component="component" data-serveside-id="se_embed_react_ssr_3"><div data-reactroot="">I am a test component</div></div><script> | ||
@@ -33,3 +34,4 @@ window.__SERVESIDE_LOAD_PROPS__ ||= {}; | ||
</script> | ||
`.trim()); | ||
`.trim(), | ||
); | ||
}); | ||
@@ -36,0 +38,0 @@ it('should set an error', async () => { |
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
11936
278