@shopify/react-html
Advanced tools
Comparing version 8.1.0 to 8.1.1
@@ -13,2 +13,8 @@ # Changelog | ||
## 8.1.1 - 2019-06-14 | ||
### Fixed | ||
- The new features from 8.1.0 are now properly exported ([#753](https://github.com/Shopify/quilt/pull/753)) | ||
## 8.1.0 - 2019-06-11 | ||
@@ -15,0 +21,0 @@ |
@@ -5,3 +5,3 @@ export * from './components'; | ||
export { showPage, getSerialized } from './utilities'; | ||
export { useDomEffect, useTitle, usePreconnect, useFavicon, useLink, useMeta, } from './hooks'; | ||
export { useDomEffect, useTitle, usePreconnect, useFavicon, useLink, useMeta, useBodyAttributes, useHtmlAttributes, } from './hooks'; | ||
export { createSerializer, useSerialized } from './serializer'; |
@@ -20,4 +20,6 @@ "use strict"; | ||
exports.useMeta = hooks_1.useMeta; | ||
exports.useBodyAttributes = hooks_1.useBodyAttributes; | ||
exports.useHtmlAttributes = hooks_1.useHtmlAttributes; | ||
var serializer_1 = require("./serializer"); | ||
exports.createSerializer = serializer_1.createSerializer; | ||
exports.useSerialized = serializer_1.useSerialized; |
@@ -11,1 +11,3 @@ export { Favicon } from './Favicon'; | ||
export { HeadUpdater } from './HeadUpdater'; | ||
export { BodyAttributes } from './BodyAttributes'; | ||
export { HtmlAttributes } from './HtmlAttributes'; |
@@ -23,1 +23,5 @@ "use strict"; | ||
exports.HeadUpdater = HeadUpdater_1.HeadUpdater; | ||
var BodyAttributes_1 = require("./BodyAttributes"); | ||
exports.BodyAttributes = BodyAttributes_1.BodyAttributes; | ||
var HtmlAttributes_1 = require("./HtmlAttributes"); | ||
exports.HtmlAttributes = HtmlAttributes_1.HtmlAttributes; |
@@ -35,3 +35,3 @@ "use strict"; | ||
}); | ||
}); | ||
}, [source]); | ||
} | ||
@@ -46,11 +46,15 @@ exports.usePreconnect = usePreconnect; | ||
}); | ||
}); | ||
}, [source]); | ||
} | ||
exports.useFavicon = useFavicon; | ||
function useHtmlAttributes(htmlAttributes) { | ||
useDomEffect(function (manager) { return manager.addHtmlAttributes(htmlAttributes); }); | ||
useDomEffect(function (manager) { return manager.addHtmlAttributes(htmlAttributes); }, [ | ||
JSON.stringify(htmlAttributes), | ||
]); | ||
} | ||
exports.useHtmlAttributes = useHtmlAttributes; | ||
function useBodyAttributes(bodyAttributes) { | ||
useDomEffect(function (manager) { return manager.addBodyAttributes(bodyAttributes); }); | ||
useDomEffect(function (manager) { return manager.addBodyAttributes(bodyAttributes); }, [ | ||
JSON.stringify(bodyAttributes), | ||
]); | ||
} | ||
@@ -57,0 +61,0 @@ exports.useBodyAttributes = useBodyAttributes; |
{ | ||
"name": "@shopify/react-html", | ||
"version": "8.1.0", | ||
"version": "8.1.1", | ||
"license": "MIT", | ||
@@ -26,3 +26,3 @@ "description": "A component to render your react app with no static HTML.", | ||
"dependencies": { | ||
"@shopify/react-effect": "^3.0.4", | ||
"@shopify/react-effect": "^3.1.0", | ||
"@shopify/react-serialize": "^1.0.15", | ||
@@ -29,0 +29,0 @@ "@shopify/useful-types": "^1.3.0", |
@@ -12,3 +12,5 @@ export * from './components'; | ||
useMeta, | ||
useBodyAttributes, | ||
useHtmlAttributes, | ||
} from './hooks'; | ||
export {createSerializer, useSerialized} from './serializer'; |
@@ -11,1 +11,3 @@ export {Favicon} from './Favicon'; | ||
export {HeadUpdater} from './HeadUpdater'; | ||
export {BodyAttributes} from './BodyAttributes'; | ||
export {HtmlAttributes} from './HtmlAttributes'; |
@@ -34,7 +34,9 @@ import {useEffect, useContext} from 'react'; | ||
export function usePreconnect(source: string) { | ||
useDomEffect(manager => | ||
manager.addLink({ | ||
rel: 'dns-prefetch preconnect', | ||
href: source, | ||
}), | ||
useDomEffect( | ||
manager => | ||
manager.addLink({ | ||
rel: 'dns-prefetch preconnect', | ||
href: source, | ||
}), | ||
[source], | ||
); | ||
@@ -44,8 +46,10 @@ } | ||
export function useFavicon(source: string) { | ||
useDomEffect(manager => | ||
manager.addLink({ | ||
rel: 'shortcut icon', | ||
type: 'image/x-icon', | ||
href: source, | ||
}), | ||
useDomEffect( | ||
manager => | ||
manager.addLink({ | ||
rel: 'shortcut icon', | ||
type: 'image/x-icon', | ||
href: source, | ||
}), | ||
[source], | ||
); | ||
@@ -57,3 +61,5 @@ } | ||
) { | ||
useDomEffect(manager => manager.addHtmlAttributes(htmlAttributes)); | ||
useDomEffect(manager => manager.addHtmlAttributes(htmlAttributes), [ | ||
JSON.stringify(htmlAttributes), | ||
]); | ||
} | ||
@@ -64,3 +70,5 @@ | ||
) { | ||
useDomEffect(manager => manager.addBodyAttributes(bodyAttributes)); | ||
useDomEffect(manager => manager.addBodyAttributes(bodyAttributes), [ | ||
JSON.stringify(bodyAttributes), | ||
]); | ||
} | ||
@@ -67,0 +75,0 @@ |
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
105614
2219
Updated@shopify/react-effect@^3.1.0