Skip to content

Releases: venmo/react-html-document

Add support for favicons.

14 Sep 20:44
Compare
Choose a tag to compare

Can now use favicon prop for favicon support. Thanks to @SpainTrain!

Firefox compatibility textContent fix

29 Aug 17:46
Compare
Choose a tag to compare

Replaces innerText with textContent on the getUniversalState helper.

First 3.0 release

14 Aug 01:53
Compare
Choose a tag to compare

Includes changes in 3.0 beta and some bug fixes. Enjoy!

Fixes

19 Jun 21:34
Compare
Choose a tag to compare
Fixes Pre-release
Pre-release

This beta release fixes some bugs found in v3.0.0-beta, namely an issue when using getUniversalState() on the client and smarter universal loading of the fs module.

New Major Release Beta

05 Jun 21:30
Compare
Choose a tag to compare
Pre-release

This major version changes a few things:

  • The state prop changes from state to universalState to reduce confusion with React state and highlight that it's used for universal rendering.
  • It's now easier to grab the universal state from the client. Just use the following from client code (in webpack or browserify apps):
import { getUniversalState } from 'react-html-document';
getUniversalState() // will give you object you passed as `universalState` prop in the server.
  • For those situations in which you'd rather inject critical css or inline scripts into the page, there's now an easier way to do it without passing in strings in the scripts prop array. To take advantage of it, just include an object like this in the scripts array:
const scripts = [{ file: '/path/to/my/file/in/the/server.js' }];
// pass as props to `HTMLDocument`

And the document will inline the js or css found in that path into the page. Note, that this caches the contents of the files in memory for faster access, so only use it for critical css or scripts.

Take a look at the included example-usage-server.js file for a real-life example.

Enjoy and thanks for your support!

Updates deps for compatibility with react 15.0

20 May 17:50
Compare
Choose a tag to compare

Update script tags to take any attribute.

11 Apr 20:18
Compare
Choose a tag to compare

Now you can add any attribute to script tags. For example:

<HTMLDocument scripts={[{ src: '/scripts/main.js', crossOrigin: 'anonymous' }]}/>

Safer state serialization

17 Dec 22:55
Compare
Choose a tag to compare

New in 2.0.0

This version introduces a small change to the way state works, but it's not backwards compatible.

Before, state would be serialized into the window object using dangerouslySetInnerHTML. This is not safe because of XSS vulnerabilities, so instead we're rendering the state on a div element on the page. For grabbing the state on the client, you'll now use that div and parse its data attribute .

const state = window.__state;

becomes

const state = JSON.parse(document.getElementById('__state').dataset.state);

Adds html attributes, fix documentation typo

25 Oct 23:28
Compare
Choose a tag to compare

Include compiled component instead of relying on babel after install

25 Oct 20:23
Compare
Choose a tag to compare