Skip to content

Commit 9528aff

Browse files
author
Ryan Johnson
authored
Release v3.0 (#81)
* fixes to typescript example * updating to v3: * remove depenency on redux * implement new LocalizeProvider * updates to existing API * remove deprecated API items * bump version to release candidate and add .npmignore * bump up release candidate version * move translationTransform option from initialize to addTranslation action * update readme and package.json for v3 * update basic example * update types * remove legacy assets * add CHANGELOG * update change log * udpate README and CHANGELOG * add new logo to README * update broken types, and add renderToStaticMarkup option to support react native * update types * update release candidate version * update ts types and add contributing guides * add yarn and prettier support * update prettier rules * update contributions section * update docs * updat readme * update readme * update logo url in readme * try and fix travis * add migration guide * fix broken links in README * Add default translate if id prop changes. (#79) * Update types. (#78) * add codecov support * add codecov dependency * add demo link to readme * bump to v3.0.0
1 parent b18dfe2 commit 9528aff

File tree

99 files changed

+16442
-16481
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+16442
-16481
lines changed

.flowconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
[ignore]
2+
./dist/.*
3+
./es/.*
4+
./lib/.*
25

36
[include]
47

@@ -7,4 +10,5 @@
710
[lints]
811

912
[options]
13+
module.ignore_non_literal_requires=true
1014
module.name_mapper='react-localize-redux' -> '<PROJECT_ROOT>/src/index.js'

.github/ISSUE_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<!--
2+
Note: if the issue is about documentation, please file it at:
3+
https://github.com/ryandrewjohnson/react-localize-redux-docs/issues
4+
-->
5+
6+
**Do you want to request a _feature_ or report a _bug_?**
7+
8+
**What is the current behavior?**
9+
10+
**If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:**
11+
12+
**What is the expected behavior?**
13+
14+
**Which versions of `react` and `react-localize-redux` are you using?**

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
**Before submitting a pull request,** please make sure the following is done:
2+
3+
1. Fork [the repository](https://github.com/ryandrewjohnson/react-localize-redux) and create your branch from `master`.
4+
2. Run `yarn` in the repository root.
5+
3. If you've fixed a bug or added code that should be tested, add tests!
6+
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test:dev` is helpful in development.
7+
5. Format your code with [prettier](https://github.com/prettier/prettier) (`yarn prettier`).
8+
6. Run the [Flow](https://flowtype.org/) typechecks (`yarn flow`).

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ es
1717
dist
1818
site
1919
.vscode
20+
demo/build

.npmignore

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
*.log
2+
npm-debug.log*
3+
node_modules
4+
.npm
5+
.vscode
6+
7+
coverage
8+
demo
9+
docs
10+
examples
11+
flow-typed
12+
site
13+
src
14+
tests
15+
16+
.babelrc
17+
.flowconfig
18+
.gitignore
19+
.travis.yml
20+
mkdocs.yml
21+
package-lock.json
22+
webpack.config.babel.js

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

.travis.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
language: node_js
22
node_js:
33
- stable
4-
- "5"
54
- "6"
65
script:
7-
- npm test
6+
- yarn test
87
after_success:
9-
- npm run coverage
8+
- yarn run coverage

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
## 3.0.0
2+
3+
* Now works without Redux by defualt.
4+
* Add [LoclaizeProvider](https://ryandrewjohnson.github.io/react-localize-docs/#localizeprovider) a wrapper around React's [Context.Provider](https://reactjs.org/docs/context.html#provider)
5+
* Add [LocalizeContext](https://reactjs.org/docs/context.html#reactcreatecontext) built on [React.createContext](https://reactjs.org/docs/context.html#reactcreatecontext).
6+
* Add [withLocalize](https://ryandrewjohnson.github.io/react-localize-docs/#withlocalize) higher-order component
7+
* Add [onMissingTranslation](https://ryandrewjohnson.github.io/react-localize-docs/#initialize) initialize option that provides more control over handling missing translations.
8+
* Optionally supports Redux by passing redux store to `LocalizeProvider`.
9+
10+
### Breaking Changes
11+
12+
* The Redux action creators `initialize`, `addTranslation`, `addTranslationForLanguage`, and `setActiveLanguage` have been removed. Instead they are now methods available on [LocalizeContext](https://ryandrewjohnson.github.io/react-localize-docs/#localizecontext), and can be added to your component's as props using the [withLocalize](https://ryandrewjohnson.github.io/react-localize-docs/#withlocalize) higher-order component.
13+
14+
* The `translationTransform` option is no longer available as an initialize option. Instead [addTranslation](https://ryandrewjohnson.github.io/react-localize-docs/#addtranslation) now takes an options object, which accepts the `translationTransform` function.
15+
16+
* This made more sense as this allows for adding transformations specific to a single translation instead of globally setting a transformation that you'd be stuck using for all translations.
17+
18+
* [initialize](https://ryandrewjohnson.github.io/react-localize-docs/#initialize) now takes a single options argument instead of multiple arguments.
19+
20+
* [Translate](https://ryandrewjohnson.github.io/react-localize-docs/#render-props-api) render props API now takes a single options object as an argument instead of multiple arguments.
21+
22+
* `renderInnerHtml` option now set to `false` by default instead of `true`.
23+
24+
* This is to mirror React's functionality where by default any children will be escaped by defualt.
25+
26+
* Remove `showMissingTranslationMsg`, `missingTranslationMsg`, `missingTranslationCallback` initialize options. THe new `onMissingTranslation` option now covers all these scenarios.
27+
28+
* Remove `setTranslations` action - instead pass `languages` to initialize.
29+
30+
* Remove `localize` higher-order component - use new `withLoclize` higher-order component instead. Or if you only require access to `translate` function use `<Translate>` component instead.
31+
32+
* If using Redux, all state related to localize will be added under the `localize` key instead of `locale`.
33+
34+
* If using Redux, `localeReducer` is now named `localizeReducer`.
35+
36+
* Fix typos in `ADD_TRANSLATION_FOR_LANGUAGE` action [(Issue #65)](https://github.com/ryandrewjohnson/react-localize-redux/issues/65)

0 commit comments

Comments
 (0)