Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions fluent-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
"localization",
"l10n"
],
"engines" : {
"node" : ">=8.9.0"
"engines": {
"node": ">=8.9.0"
},
"devDependencies": {
"jsdom": "^9.12.0"
Expand Down
4 changes: 2 additions & 2 deletions fluent-intl-polyfill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"localization",
"l10n"
],
"engines" : {
"node" : ">=8.9.0"
"engines": {
"node": ">=8.9.0"
},
"dependencies": {
"intl-pluralrules": "projectfluent/IntlPluralRules#module"
Expand Down
4 changes: 2 additions & 2 deletions fluent-langneg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"localization",
"l10n"
],
"engines" : {
"node" : ">=8.9.0"
"engines": {
"node": ">=8.9.0"
}
}
14 changes: 9 additions & 5 deletions fluent-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,15 @@ version of Babel's [latest preset][]:
import 'fluent-react/compat';
```

In some cases, using the `compat` build may be needed even if you target modern
browsers. For instance, the `create-react-app` boilerplate uses UglifyJS to
minify its files. As of April 2017, UglifyJS doesn't support some of the new
JavaScript syntax features. By using the `compat` build of all `fluent`
packages you can ensure that the minifiction works properly.
In some cases, using the `compat` build may be needed even if you target
modern browsers. For instance, the [`create-react-app` boilerplate uses
UglifyJS to minify its files][create-react-app-minify]. As of November 2017,
UglifyJS doesn't support some of the new JavaScript syntax features. By using
the `compat` build of all `fluent` packages you can ensure that the
minifiction works properly.


[create-react-app-minify]: https://github.com/facebookincubator/create-react-app/blob/master/packages/react-scripts/template/README.md#npm-run-build-fails-to-minify


## Learn more
Expand Down
4 changes: 4 additions & 0 deletions fluent-react/examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ These tiny React apps demonstrate how `fluent-react` can integrate with React.
cd hello-world
npm install
npm start

All examples link to the local ES2015+ `fluent` modules as dependencies. They
are resolved via the `module` field of their `package.json` files and thus do
not require to be built nor transpiled beforehand.
16 changes: 8 additions & 8 deletions fluent-react/examples/async-messages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.9.0"
"react-scripts": "1.0.17"
},
"dependencies": {
"delay": "^1.3.1",
"fluent": "^0.4.0",
"fluent-intl-polyfill": "^0.1.0",
"fluent-langneg": "^0.1.0",
"fluent-react": "^0.3.0",
"react": "^15.4.2",
"react-dom": "^15.4.2"
"delay": "^2.0.0",
"fluent": "file:../../../fluent",
"fluent-intl-polyfill": "file:../../../fluent-intl-polyfill",
"fluent-langneg": "file:../../../fluent-langneg",
"fluent-react": "file:../../../fluent-react",
"react": "^16.1.1",
"react-dom": "^16.1.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/async-messages/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Localized } from 'fluent-react/compat';
import { Localized } from 'fluent-react';

export default function App() {
return (
Expand Down
8 changes: 4 additions & 4 deletions fluent-react/examples/async-messages/src/l10n.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import React, { Component } from 'react';
import delay from 'delay';

import 'fluent-intl-polyfill/compat';
import { MessageContext } from 'fluent/compat';
import { LocalizationProvider } from 'fluent-react/compat';
import { negotiateLanguages } from 'fluent-langneg/compat';
import 'fluent-intl-polyfill';
import { MessageContext } from 'fluent';
import { LocalizationProvider } from 'fluent-react';
import { negotiateLanguages } from 'fluent-langneg';

async function fetchMessages(locale) {
const { PUBLIC_URL } = process.env;
Expand Down
14 changes: 7 additions & 7 deletions fluent-react/examples/change-language/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.9.0"
"react-scripts": "1.0.17"
},
"dependencies": {
"fluent": "^0.4.0",
"fluent-intl-polyfill": "^0.1.0",
"fluent-langneg": "^0.1.0",
"fluent-react": "^0.3.0",
"react": "^15.4.2",
"react-dom": "^15.4.2"
"fluent": "file:../../../fluent",
"fluent-intl-polyfill": "file:../../../fluent-intl-polyfill",
"fluent-langneg": "file:../../../fluent-langneg",
"fluent-react": "file:../../../fluent-react",
"react": "^16.1.1",
"react-dom": "^16.1.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/change-language/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Localized } from 'fluent-react/compat';
import { Localized } from 'fluent-react';

export default function App(props) {
const { currentLocales, handleLocaleChange } = props;
Expand Down
8 changes: 4 additions & 4 deletions fluent-react/examples/change-language/src/l10n.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React, { cloneElement, Children, Component } from 'react';

import 'fluent-intl-polyfill/compat';
import { MessageContext } from 'fluent/compat';
import { LocalizationProvider } from 'fluent-react/compat';
import { negotiateLanguages } from 'fluent-langneg/compat';
import 'fluent-intl-polyfill';
import { MessageContext } from 'fluent';
import { LocalizationProvider } from 'fluent-react';
import { negotiateLanguages } from 'fluent-langneg';

const MESSAGES_ALL = {
'pl': `
Expand Down
12 changes: 6 additions & 6 deletions fluent-react/examples/fallback-sync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.9.0"
"react-scripts": "1.0.17"
},
"dependencies": {
"fluent": "^0.4.0",
"fluent-intl-polyfill": "^0.1.0",
"fluent-react": "^0.3.0",
"react": "^15.4.2",
"react-dom": "^15.4.2"
"fluent": "file:../../../fluent",
"fluent-intl-polyfill": "file:../../../fluent-intl-polyfill",
"fluent-react": "file:../../../fluent-react",
"react": "^16.1.1",
"react-dom": "^16.1.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/fallback-sync/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Hello world - a fluent-react example</title>
<title>Fallback Sync - a fluent-react example</title>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/fallback-sync/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Localized } from 'fluent-react/compat';
import { Localized } from 'fluent-react';

export default function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/fallback-sync/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { LocalizationProvider } from 'fluent-react/compat';
import { LocalizationProvider } from 'fluent-react';

import { generateMessages } from './l10n';
import App from './App';
Expand Down
5 changes: 2 additions & 3 deletions fluent-react/examples/fallback-sync/src/l10n.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'fluent-intl-polyfill/compat';
import { MessageContext } from 'fluent/compat';
import 'fluent-intl-polyfill';
import { MessageContext } from 'fluent';

const MESSAGES_ALL = {
'pl': `
Expand All @@ -18,4 +18,3 @@ export function* generateMessages() {
yield cx;
}
}

14 changes: 7 additions & 7 deletions fluent-react/examples/hello-world/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.9.0"
"react-scripts": "1.0.17"
},
"dependencies": {
"fluent": "^0.4.0",
"fluent-intl-polyfill": "^0.1.0",
"fluent-langneg": "^0.1.0",
"fluent-react": "^0.3.0",
"react": "^15.4.2",
"react-dom": "^15.4.2"
"fluent": "file:../../../fluent",
"fluent-intl-polyfill": "file:../../../fluent-intl-polyfill",
"fluent-langneg": "file:../../../fluent-langneg",
"fluent-react": "file:../../../fluent-react",
"react": "^16.1.1",
"react-dom": "^16.1.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/hello-world/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Localized } from 'fluent-react/compat';
import { Localized } from 'fluent-react';

export default function App() {
return (
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/hello-world/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { LocalizationProvider } from 'fluent-react/compat';
import { LocalizationProvider } from 'fluent-react';

import { generateMessages } from './l10n';
import App from './App';
Expand Down
7 changes: 3 additions & 4 deletions fluent-react/examples/hello-world/src/l10n.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'fluent-intl-polyfill/compat';
import { MessageContext } from 'fluent/compat';
import { negotiateLanguages } from 'fluent-langneg/compat';
import 'fluent-intl-polyfill';
import { MessageContext } from 'fluent';
import { negotiateLanguages } from 'fluent-langneg';

const MESSAGES_ALL = {
'pl': `
Expand All @@ -25,4 +25,3 @@ export function* generateMessages(userLocales) {
yield cx;
}
}

14 changes: 7 additions & 7 deletions fluent-react/examples/higher-order/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.9.0"
"react-scripts": "1.0.17"
},
"dependencies": {
"fluent": "^0.4.0",
"fluent-intl-polyfill": "^0.1.0",
"fluent-langneg": "^0.1.0",
"fluent-react": "^0.3.0",
"react": "^15.4.2",
"react-dom": "^15.4.2"
"fluent": "file:../../../fluent",
"fluent-intl-polyfill": "file:../../../fluent-intl-polyfill",
"fluent-langneg": "file:../../../fluent-langneg",
"fluent-react": "file:../../../fluent-react",
"react": "^16.1.1",
"react-dom": "^16.1.1"
},
"scripts": {
"start": "react-scripts start",
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/higher-order/src/App.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { Localized, withLocalization } from 'fluent-react/compat';
import { Localized, withLocalization } from 'fluent-react';

function App(props) {
function showAlert() {
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/higher-order/src/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { LocalizationProvider } from 'fluent-react/compat';
import { LocalizationProvider } from 'fluent-react';

import { generateMessages } from './l10n';
import App from './App';
Expand Down
7 changes: 3 additions & 4 deletions fluent-react/examples/higher-order/src/l10n.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'fluent-intl-polyfill/compat';
import { MessageContext } from 'fluent/compat';
import { negotiateLanguages } from 'fluent-langneg/compat';
import 'fluent-intl-polyfill';
import { MessageContext } from 'fluent';
import { negotiateLanguages } from 'fluent-langneg';

const MESSAGES_ALL = {
'pl': `
Expand All @@ -27,4 +27,3 @@ export function* generateMessages(userLocales) {
yield cx;
}
}

22 changes: 11 additions & 11 deletions fluent-react/examples/redux-async/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
"version": "0.1.0",
"private": true,
"devDependencies": {
"react-scripts": "0.9.0"
"react-scripts": "1.0.17"
},
"dependencies": {
"delay": "^1.3.1",
"fluent": "^0.4.0",
"fluent-intl-polyfill": "^0.1.0",
"fluent-langneg": "^0.1.0",
"fluent-react": "^0.3.0",
"react": "^15.4.2",
"react-dom": "^15.4.2",
"react-redux": "^5.0.2",
"redux": "^3.6.0",
"redux-logger": "^2.8.1",
"delay": "^2.0.0",
"fluent": "file:../../../fluent",
"fluent-intl-polyfill": "file:../../../fluent-intl-polyfill",
"fluent-langneg": "file:../../../fluent-langneg",
"fluent-react": "file:../../../fluent-react",
"react": "^16.1.1",
"react-dom": "^16.1.1",
"react-redux": "^5.0.6",
"redux": "^3.7.2",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/redux-async/src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { connect} from 'react-redux';
import { Localized } from 'fluent-react/compat';
import { Localized } from 'fluent-react';

import { changeLocales } from './actions';

Expand Down
4 changes: 2 additions & 2 deletions fluent-react/examples/redux-async/src/actions.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { MessageContext } from 'fluent/compat';
import { negotiateLanguages } from 'fluent-langneg/compat';
import { MessageContext } from 'fluent';
import { negotiateLanguages } from 'fluent-langneg';
import delay from 'delay';

async function fetchMessages(locale) {
Expand Down
4 changes: 2 additions & 2 deletions fluent-react/examples/redux-async/src/l10n.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';

import 'fluent-intl-polyfill/compat';
import { LocalizationProvider } from 'fluent-react/compat';
import 'fluent-intl-polyfill';
import { LocalizationProvider } from 'fluent-react';

import { changeLocales } from './actions';

Expand Down
2 changes: 1 addition & 1 deletion fluent-react/examples/redux-async/src/store.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import createLogger from 'redux-logger';
import { createLogger } from 'redux-logger';

import reducer from './reducer';

Expand Down
Loading