-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples upgrade #1393
Comments
|
We have without SWC - js-lingui/examples/next-js, with SWC - swc-plugin/examples/nextjs-13, isn't it? |
Correct, but it is hard to discover when they exist in two different repos, and it's hard to understand a difference between them. I would suggest: create two folders with distinctive name: And either move nextjs example from SWC repo to here, or create in It's quite handy when you have all examples in one place, like there https://github.com/vercel/next.js/tree/canary/examples Also nextjs example in the main repo is broken. Here i posted an explanation #1265 |
Yeah, it's better to have all the examples in one place and additionally we should consider adding a small section with the links so users will be able to easily find all these examples. |
I would be happy to see at least one working example with nodejs, typescript and extract parser. So far could not find anything, or lingui is not intended to work with nodejs without hacks? |
@bafxyz if you accepting to use babel or swc for precompiling you backend code, everything should work without any hacks. but bear in mind that lingui is made mostly for frontend code and some solutions might be overengenireed for backend code. |
Yes it works perfectly fine with nextjs for me, but at the same time i could not make it work in nodejs. Would be great to see codesandbox with swc, typescript |
the nodejs example is too wide. it all depends on the frameworks you use. For example, nestjs and express would be completely different examples. |
I'm not using any frameworks. Pure nodejs BE written in typescript which i'm running with https://www.npmjs.com/package/tsx but parser can be replaced with swc it's not a problem. I was writing simple bot for telegram messenger and because of my love to PO file format i tried to use lingui. But yeah, it was not easy to find some examples |
@andrii-bodnar |
@gpessa that's why this task exists. It has to be updated. |
Is there a Next.js App Router example? |
Try this one https://github.com/sultan99/next.js-v13 |
@bafxyz thanks, trying it right now. Just failed with adapting the SWC example code. |
Well, if I use a client component, the following error occurs:
And in case of a server component, t is not defined as a function. Is this supposed to support both cases? At least the middleware checks both cases and the used provider should also support it but the lingui code fails. |
@cbratschi that means you're trying to use Macro without actual transpiling Macro. To use macro you have to use either babel-plugin-macros or @lingui/swc-plugin |
@thekip thanks, the SWC plugin works fine for client components (first failed but after switching to server component and back to client component suddenly was working). Are Server Components supported too? I am getting a useContext() error. |
@thekip , please add some turborepo + vite + react examples as well, monorepo docs are not much clear |
The examples are extremely outdated and need to be upgraded
The text was updated successfully, but these errors were encountered: