@lingui/swc-plugin 6.0.0-next.3 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -53,7 +53,7 @@ https://swc.rs/docs/configuration/swcrc
53
53
  //
54
54
  // Optional. Controls which descriptor fields are preserved in output.
55
55
  // "descriptorFields": "auto" (default) | "all" | "id-only" | "message"
56
-
56
+ //
57
57
  // Compatibility option allows to use v6.* SWC Plugin release channel with @lingui/cli@5.*
58
58
  // Controls the BASE64 alphabet used for generating message IDs.
59
59
  // - false (default): Uses URL-safe BASE64 alphabet (Lingui v6 behavior)
@@ -61,9 +61,11 @@ https://swc.rs/docs/configuration/swcrc
61
61
  //
62
62
  // IMPORTANT: This option is temporal and will be removed in the next major release.
63
63
  // "useLinguiV5IdGeneration": true
64
- // Lingui strips non-essential fields in production builds for performance.
65
- // You can override the default behavior with:
66
- // "stripNonEssentialFields": false/true
64
+ //
65
+ // Optional. Restricts directive-based idPrefix application to explicit ids
66
+ // starting with this leader string, while keeping the leader in the final id.
67
+ // "idPrefixLeader": "."
68
+ //
67
69
  // To configure custom JSX placeholder attribute and its defaults:
68
70
  // "jsxPlaceholderAttribute": "_t",
69
71
  // "jsxPlaceholderDefaults": {
@@ -89,6 +91,16 @@ Controls which fields are preserved in the transformed message descriptors. Acce
89
91
 
90
92
  Check [this article](https://lingui.dev/guides/optimizing-bundle-size) for more info about this configuration.
91
93
 
94
+ ### `idPrefixLeader`
95
+
96
+ Controls how directive-based `idPrefix` values are applied to explicit message ids.
97
+
98
+ - When omitted, `idPrefix` is prepended to explicit static ids.
99
+ - When set, `idPrefix` is prepended only when the explicit static id starts with the configured leader string.
100
+ - Auto-generated hash ids are never prefixed.
101
+
102
+ See [Lingui macro docs](https://lingui.dev/ref/macro) for comment directive syntax and semantics. The SWC plugin matches the Babel macro behavior.
103
+
92
104
  Or Next JS Usage:
93
105
 
94
106
  `next.config.js`
@@ -121,29 +133,29 @@ Below is a table referencing the `swc_core` version used during the plugin build
121
133
 
122
134
  To learn more about SWC Plugins compatibility check this issue https://github.com/lingui/swc-plugin/issues/179
123
135
 
124
- | Plugin Version | used `swc_core` |
125
- |---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
126
- | `0.1.0`, `4.0.0-next.0` | `0.52.8` |
127
- | `0.2.*`, `4.0.0-next.1` ~ `4.0.0-next.3` | `0.56.1` |
128
- | `4.0.0` | `0.75.33` |
129
- | `4.0.1` | `0.76.0` |
130
- | `4.0.2` | `0.76.41` |
131
- | `4.0.3` | `0.78.28` |
132
- | `4.0.4` | `0.79.x` |
133
- | `4.0.5`, `4.0.6` | [`0.87.x`](https://plugins.swc.rs/versions/range/10) |
134
- | `4.0.7`, `4.0.8`, `5.0.0-next.0` ~ `5.0.0-next.1` | [`0.90.35`](https://plugins.swc.rs/versions/range/12) |
135
- | `4.0.9` | [`0.96.9`](https://plugins.swc.rs/versions/range/15) |
136
- | `4.0.10` | [`0.101.4`](https://plugins.swc.rs/versions/range/94) |
137
- | `4.1.0`, `5.0.0` ~ `5.2.0` | [`0.106.3`](https://plugins.swc.rs/versions/range/95) |
138
- | `5.3.0` | [`5.0.4`](https://plugins.swc.rs/versions/range/116) |
139
- | `5.4.0` | [`14.1.0`](https://plugins.swc.rs/versions/range/138) |
140
- | `5.5.0` ~ `5.5.2` | [`15.0.1`](https://plugins.swc.rs/versions/range/271) |
141
- | `5.6.0` ~ `5.6.1` | [`27.0.6`](https://plugins.swc.rs/versions/range/364) |
142
- | `5.7.0` | [`39.0.3`](https://plugins.swc.rs/versions/range/426) |
143
- | `5.8.0` | [`45.0.2`](https://plugins.swc.rs/versions/range/497) |
144
- | `5.9.0` | [`46.0.3`](https://plugins.swc.rs/versions/range/713) |
145
- | `5.10.0` | [`50.2.3`](https://plugins.swc.rs/versions/range/768) |
146
- | `5.10.1`, `5.11.0` | [`50.2.3`](https://plugins.swc.rs/versions/range/768) with [`--cfg=swc_ast_unknown`](https://swc.rs/docs/plugin/ecmascript/compatibility#make-your-plugin-compatible) |
136
+ | Plugin Version | used `swc_core` |
137
+ |-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------|
138
+ | `0.1.0`, `4.0.0-next.0` | `0.52.8` |
139
+ | `0.2.*`, `4.0.0-next.1` ~ `4.0.0-next.3` | `0.56.1` |
140
+ | `4.0.0` | `0.75.33` |
141
+ | `4.0.1` | `0.76.0` |
142
+ | `4.0.2` | `0.76.41` |
143
+ | `4.0.3` | `0.78.28` |
144
+ | `4.0.4` | `0.79.x` |
145
+ | `4.0.5`, `4.0.6` | [`0.87.x`](https://plugins.swc.rs/versions/range/10) |
146
+ | `4.0.7`, `4.0.8`, `5.0.0-next.0` ~ `5.0.0-next.1` | [`0.90.35`](https://plugins.swc.rs/versions/range/12) |
147
+ | `4.0.9` | [`0.96.9`](https://plugins.swc.rs/versions/range/15) |
148
+ | `4.0.10` | [`0.101.4`](https://plugins.swc.rs/versions/range/94) |
149
+ | `4.1.0`, `5.0.0` ~ `5.2.0` | [`0.106.3`](https://plugins.swc.rs/versions/range/95) |
150
+ | `5.3.0` | [`5.0.4`](https://plugins.swc.rs/versions/range/116) |
151
+ | `5.4.0` | [`14.1.0`](https://plugins.swc.rs/versions/range/138) |
152
+ | `5.5.0` ~ `5.5.2` | [`15.0.1`](https://plugins.swc.rs/versions/range/271) |
153
+ | `5.6.0` ~ `5.6.1` | [`27.0.6`](https://plugins.swc.rs/versions/range/364) |
154
+ | `5.7.0` | [`39.0.3`](https://plugins.swc.rs/versions/range/426) |
155
+ | `5.8.0` | [`45.0.2`](https://plugins.swc.rs/versions/range/497) |
156
+ | `5.9.0` | [`46.0.3`](https://plugins.swc.rs/versions/range/713) |
157
+ | `5.10.0` | [`50.2.3`](https://plugins.swc.rs/versions/range/768) |
158
+ | `5.10.1` ~ `*` <br/> Starting from this version Wasm plugins are compatible between `@swc/core` versions to some extent. Read more [here](https://swc.rs/docs/plugin/ecmascript/compatibility#make-your-plugin-compatible). | [`50.2.3`](https://plugins.swc.rs/versions/range/768) with [`--cfg=swc_ast_unknown`](https://swc.rs/docs/plugin/ecmascript/compatibility#make-your-plugin-compatible) |
147
159
 
148
160
 
149
161
  > **Note**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lingui/swc-plugin",
3
- "version": "6.0.0-next.3",
3
+ "version": "6.1.0",
4
4
  "description": "A SWC Plugin for LinguiJS",
5
5
  "author": {
6
6
  "name": "Timofei Iatsenko",
@@ -19,7 +19,7 @@
19
19
  "icu",
20
20
  "message-format",
21
21
  "i18n",
22
- "internalization"
22
+ "internationalization"
23
23
  ],
24
24
  "main": "target/wasm32-wasip1/release/lingui_macro_plugin.wasm",
25
25
  "exports": {