Repository navigation
Replies: 1 comment
|
My suggestion is just name this function as "msg core" and "t core", as they are the most pure without any dependency, and put them right into the Then, the Babel and SWC plugins - name as "msg macro" and "t macro" - keep into the And the React component -name just as "Lingui Trans component", and keep in the This extraction of the macro to a separate component should also decrease the confusion of seeing the same functions What do you think about this? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
In the PR #2618 there is a brand new feature implemented, that allows using Lingui in pure JS projects!
Yes, even in your raw cli scripts, written in pure JS, it can be used without any Babel, SWC and other JS transpilers, and even without TypeScript!
During the development, this feature was called as "runtime macro" and planned to release as a separate package.
But for me it looks not very clear, because actually there is no "macro" there, it's just a pure JS function, that does the translation!
It's even the opposite: The actual macro is the current implementations of the function
tin the@lingui/core/macroand@lingui/core/macro, but the new native translation function is not the macro, it stays as is in the app!Also, it looks like the main root function, that missed before, and all the macros are actually just superstructures above it.
So, before this feature we had:
msgandt<Trans>and now with this new feature we finally have the full flow:
msgandtmsgandt<Trans>So, pure JS projects can just use the pure "Native JS function
msg" from core without any dependency onbabel, TypeScript, and other transpilers and different sugar!So, let's try to discuss here the right naming, placement in the structure, and positioning of this feature with the Lingui community, to choose the best option together!
All reactions