@fluent/react
Advanced tools
Comparing version 0.11.0 to 0.11.1
# Changelog | ||
## @fluent/react 0.11.1 (January 31, 2020) | ||
- Don't call `createParseMarkup` too eagerly. (#453) | ||
Fix a regression from 0.11.0 in which the default `FluentContext` value | ||
was an empty `ReactLocalization` which would call `createParseMarkup` to | ||
create its markup parser. In SSR, it's not desirable to call this | ||
function as it uses the `document` global. | ||
## @fluent/react 0.11.0 (January 23, 2020) | ||
@@ -4,0 +13,0 @@ |
@@ -1,2 +0,2 @@ | ||
/* @fluent/react@0.11.0 */ | ||
/* @fluent/react@0.11.1 */ | ||
(function (global, factory) { | ||
@@ -89,3 +89,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('@fluent/sequence/compat'), require('cached-iterable/compat')) : | ||
var FluentContext = react.createContext(new ReactLocalization([])); | ||
var FluentContext = react.createContext(new ReactLocalization([], null)); | ||
@@ -459,3 +459,3 @@ /* | ||
if (!reMarkup.test(messageValue)) { | ||
if (!reMarkup.test(messageValue) || l10n.parseMarkup === null) { | ||
return react.cloneElement(child, localizedProps, messageValue); | ||
@@ -462,0 +462,0 @@ } // If the message contains markup, parse it and try to match the children |
@@ -1,2 +0,2 @@ | ||
/* @fluent/react@0.11.0 */ | ||
/* @fluent/react@0.11.1 */ | ||
(function (global, factory) { | ||
@@ -87,3 +87,3 @@ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react'), require('prop-types'), require('@fluent/sequence'), require('cached-iterable')) : | ||
var FluentContext = react.createContext(new ReactLocalization([])); | ||
var FluentContext = react.createContext(new ReactLocalization([], null)); | ||
@@ -350,3 +350,3 @@ /* | ||
// insert it as the only child of the wrapped component. | ||
if (!reMarkup.test(messageValue)) { | ||
if (!reMarkup.test(messageValue) || l10n.parseMarkup === null) { | ||
return react.cloneElement(child, localizedProps, messageValue); | ||
@@ -353,0 +353,0 @@ } |
{ | ||
"name": "@fluent/react", | ||
"description": "Fluent bindings for React", | ||
"version": "0.11.0", | ||
"version": "0.11.1", | ||
"homepage": "https://projectfluent.org", | ||
@@ -60,3 +60,3 @@ "author": "Mozilla <l10n-drivers@mozilla.org>", | ||
"@babel/preset-react": "7.0.0", | ||
"@fluent/bundle": "^0.14.0", | ||
"@fluent/bundle": "^0.15.0", | ||
"babel-jest": "^24.8.0", | ||
@@ -63,0 +63,0 @@ "babel-plugin-transform-rename-import": "^2.2.0", |
import { createContext } from "react"; | ||
import ReactLocalization from "./localization"; | ||
export default createContext(new ReactLocalization([])); | ||
export default createContext(new ReactLocalization([], null)); |
@@ -138,3 +138,3 @@ import { isValidElement, cloneElement, useContext } from "react"; | ||
// insert it as the only child of the wrapped component. | ||
if (!reMarkup.test(messageValue)) { | ||
if (!reMarkup.test(messageValue) || l10n.parseMarkup === null) { | ||
return cloneElement(child, localizedProps, messageValue); | ||
@@ -141,0 +141,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
64804
17
1124