Skip to content

Commit 48d791c

Browse files
authored
0.9.0 changes and readme (#60)
1 parent 86d7236 commit 48d791c

File tree

2 files changed

+53
-22
lines changed

2 files changed

+53
-22
lines changed

Diff for: CHANGELOG.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,19 @@
11
# Changelog
22

3+
## 0.9.0 - 2020-06-19
4+
5+
- Upgraded Reason parser to Reason 3.6.0 (release).
6+
- OCaml 4.08, Dune 2.
7+
- Migrated tests to [Rely](https://reason-native.com/docs/rely/).
8+
- Moved CI to GitHub Actions.
9+
- macOS, Linux and Windows binaries built by CI.
10+
311
## 0.8.0 - 2020-02-12
412

513
- Upgraded Reason parser to Reason 3.6.0 (8f71db0)
614
- Upgraded dependencies.
715

8-
## 0.8.0 - 2019-02-12
16+
## 0.7.0 - 2019-02-12
917

1018
- Upgraded Reason parser to Reason 3.4.0.
1119
- Upgraded dependencies.

Diff for: README.md

+44-21
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,30 @@ where `path` is a Reason source file or a directory containing Reason source fil
2626

2727
The `--allow-duplicates` option allows messages with identical `id` props if the `defaultMessage` props are identical as well.
2828

29-
Formatted messages may be defined in your source files in one of the following three ways:
29+
## Output
30+
31+
The output (a JSON array of all extracted messages sorted by id) is written to stdout. It will look like this:
32+
33+
```json
34+
[
35+
{
36+
"id": "message.hello",
37+
"defaultMessage": "Hello"
38+
},
39+
{
40+
"id": "message.world",
41+
"defaultMessage": "World"
42+
},
43+
{
44+
"id": "some.message.id",
45+
"defaultMessage": "Some message"
46+
}
47+
]
48+
```
49+
50+
## Message Definition (bs-react-intl 2.x)
51+
52+
Formatted messages may be defined in your source files in one of the following ways:
3053

3154
1. inline in `FormattedMessage`:
3255

@@ -42,6 +65,25 @@ open ReactIntl;
4265
<FormattedMessage id="some.message.id" defaultMessage="Some message" />
4366
```
4467

68+
2. within a module with the `[@intl.messages]` attribute:
69+
70+
```reason
71+
open ReactIntl;
72+
73+
module Msg = {
74+
[@intl.messages];
75+
76+
let hello = {id: "message.hello", defaultMessage: "Hello"};
77+
let world = {id: "message.world", defaultMessage: "World"};
78+
};
79+
```
80+
81+
## Message Definition (bs-react-intl 1.x)
82+
83+
Formatted messages may be defined in your source files in one of the following ways:
84+
85+
1. inline in `FormattedMessage` (see above)
86+
4587
2. using `ReactIntl.defineMessages`:
4688

4789
```reason
@@ -93,30 +135,11 @@ let messages =
93135
};
94136
```
95137

96-
The output (a JSON array of all extracted messages sorted by id) is written to stdout. It will look like this:
97-
98-
```json
99-
[
100-
{
101-
"id": "message.hello",
102-
"defaultMessage": "Hello"
103-
},
104-
{
105-
"id": "message.world",
106-
"defaultMessage": "World"
107-
},
108-
{
109-
"id": "some.message.id",
110-
"defaultMessage": "Some message"
111-
}
112-
]
113-
```
114-
115138
## Building and Testing
116139

117140
Install [esy] as follows:
118141

119-
% npm install -g esy@latest
142+
% npm install -g esy
120143

121144
Then you can install the project dependencies using:
122145

0 commit comments

Comments
 (0)