Closed ljani closed 3 years ago
I like the ... write an esbuild plugin
option but it will add yet another snowpack related package, given #947
Anyway, good to have alternative solutions since there are many other use cases people work with, e.g. one can just use typescript plugin without esbuild or babel at all.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Came here from #989 and just wanted to voice my support for this part of the proposal:
The first thing that came to my mind is using tagged templates. lingui used to support them (with i18n.t), but the support was removed in v3.
Having to adopt babel just for the sake of macros was really painful.
There's the low-level i18n._, but it's not very type-safe. It's easy to forget the parameters.
What I understood from #989 is that i18n._
won't produce a catalog when running lingui extract
. Is that right?
BTW, any chance to ask stale-bot to ignore this issue?
Is your feature request related to a problem? Please describe. Snowpack is an emerging [1,2] build tool for web frontends. It focuses on build performance by using
esbuild
and additionally by avoiding transpilation withbabel
. Thus, many Snowpack users try to avoid usage ofbabel
in their development pipeline.As
lingui
relies heavily onbabel-plugin-macros
, it would be nice to see an alternative, type-safe API withoutbabel-plugin-macros
to be used with for example Snowpack.Describe proposed solution
lingui
used to support them (withi18n.t
), but the support was removed in v3. I'm not sure why they were removed, or if there are any challenges to them, but I wonder if they could be revived?Describe alternatives you've considered
i18n._
, but it's not very type-safe. It's easy to forget the parameters.babel
to Snowpack, however it has some performance hit on building and generally many Snowpack users try to avoid it.i18n._
.babel-plugin-macros
?Additional context See also: https://github.com/lingui/js-lingui/discussions/924, https://github.com/lingui/js-lingui/issues/944, https://github.com/lingui/js-lingui/pull/947