Commit graph

19 commits

Author SHA1 Message Date
Long Ho
67b67b28b2
feat(examples/with-react-intl): add locale negotation to client side (#16806)
fix #16752

cc @thuringia
2020-09-16 23:01:21 +00:00
Long Ho
6f60a22377
fix: fix hashing algo and locale value hydration (#16692)
- Fix hashing algo for extraction so it's the same as babel config
- Fix locale persistence issue
fix #16689
2020-09-01 01:33:24 +00:00
Jesse Jafa
ce994365b7
Add cross-env to ensure examples work on Windows 10 (#16694)
Closes https://github.com/vercel/next.js/issues/16693
2020-08-30 06:53:29 +00:00
Joe Haddad
f17d435166
Ensure all examples are MIT licensed (#16691) 2020-08-29 22:32:35 -04:00
Jesse Jafa
694ccc7ca0
Upgrade typescript to 4.0 (#16673) 2020-08-29 22:17:02 -04:00
Long Ho
5a478b4eef
feat: upgrade react-intl workflow in example (#16215)
Changes:
- Migrate to TypeScript. `react-intl` natively supports TypeScript now.
- Upgrade corresponding `formatjs` packages.
- Dynamically polyfill Intl API per locale since those polyfills are huge.
- Migrate to recommended workflow per https://formatjs.io/docs/getting-started/application-workflow
2020-08-27 22:59:33 +00:00
Jon Espen Kvisler
1409cd6e3f
Update next-transpile-modules in with-react-intl example (#15730)
next-transpile-modules needs to be updated to support Next.js 9.5

Closes #15725
2020-07-31 07:14:37 +00:00
James Mosier
d75da7d91f
Using cross-spawn for cross platform use in with-react-intl (#14231)
[In this Discussion](https://github.com/vercel/next.js/discussions/14220) it appears that trying to build the `with-react-intl` example with a Windows machine throws an error. So instead of using `execFileSync` to execute the command, I used [`cross-spawn` ](https://www.npmjs.com/package/cross-spawn) for better cross platform compatibility.
2020-06-16 15:59:59 +00:00
Jon Espen Kvisler
b516c4ea23
Transpile packages in react-intl example (#11849) 2020-05-02 01:22:25 -04:00
Fabian Mastenbroek
9e75162a27
[examples/with-react-intl] Fix issues with Intl.js polyfill (#11806)
* Add workaround for Intl.js RegEx issue

This change adds a workaround for an issue with the Intl.js polyfill
library where it instantiates an invalid regular expression.

Relevant issues:
https://github.com/andyearnshaw/Intl.js/issues/270
https://github.com/andyearnshaw/Intl.js/issues/256
https://github.com/andyearnshaw/Intl.js/issues/306

Until this issue is fixed upstream, we use a workaround in the example.

Fixes: #11777

* Do not load Intl.js polyfill by default on Node

This change updates the `with-react-intl` example to prevent it from
polyfilling `Intl` in a Node environment when it is not needed.
2020-04-13 13:55:30 -04:00
s
921f7544c1 [with-react-intl] Fix message extraction script on consecutive builds (#9788)
* Remove next folder before build in with-react-intl

* Relax message id requirement in with-react-intl

* @formatjs/cli instead of babel-plugin-react-intl

* default-lang.js -> extract.js

Co-authored-by: Joe Haddad <timer150@gmail.com>
2019-12-23 15:32:55 -05:00
Raymond
d5486e5b9a Add full-icu package (#9286)
As long as node does not ship with fill-icu this will do the trick making FormattedRelativeTime work on nodejs.
Other polyfill like @formatjs/intl-relativetimeformat/polyfill did not work on nodejs and thus giving an error that client did not match server.
2019-11-09 13:04:38 -08:00
Tage A. L. K
9efed17503 Update with-react-intl for v3 (#8526)
* Update dependencies

> Update dependencies

* Changes to make v3 work

> Use hook `useIntl` instead of HOC `injectIntl`
> Change use of class components
> Changes to dependencies

* Small changes

Small changes
2019-08-26 15:40:36 -05:00
Juan Olvera
7e12997af6 Test updater script on examples folder (#5993)
I wrote a [script](https://github.com/j0lv3r4/dependency-version-updater) to update dependencies recursively in `package.json` files, e.g.:

```
$ node index.js --path="./examples" --dependencies="react=^16.7.0,react-dom=^16.7.0"
```

This PR contains the result against the examples folder.
2019-01-05 12:19:27 +01:00
Rustam Gilyaziev
e2b518525c Update with-react-intl example (#4825)
Changes:
- added withIntl HOC because injectIntl do no hoist static methods
- fixed `Cannot read property 'locale' of undefined`
2018-07-24 00:43:57 +02:00
Tim Neutkens
47d3cfd0fd Upgrade React for all examples (#3113) 2017-10-17 08:11:46 +02:00
Henrik
f14297dc80 Normalize example package.json files (#2350) 2017-06-23 10:46:44 +02:00
Tim Neutkens
7f0591896a Use latest version of Next for all examples (#1597)
* Use latest for all examples

* Update yarn.lock
2017-04-03 09:46:35 +05:30
Eric Ferraiuolo
e24db68f8b Add example app with React Intl (#1055)
* Add example app with React Intl

Fixes #1022

* Update examples/with-react-intl/package.json to be consistent
2017-02-24 22:45:18 +01:00