Replies: 6 comments 7 replies
-
If next-translate uses a babel parser, does it mean that next will not use SWC ? |
Beta Was this translation helpful? Give feedback.
-
As far as fixing #827 is concerned, the TypeScript version works and the Babel version doesn't. Not sure if there are other differences, but I would just use the TS version. |
Beta Was this translation helpful? Give feedback.
-
Hey @aralroca, I'd be open to fix the bugs with the babel parser, we just need to add a test for the failing case and it'll be good to go in no time. However the typescript compiler also looks good to me, in the end it really doesn't make a difference. Both tools generate AST for the source code, it just looks slightly differently. |
Beta Was this translation helpful? Give feedback.
-
For what it's worth, I've been using the TS version ( |
Beta Was this translation helpful? Give feedback.
-
We ultimately decided to implement @StLyn4's version using the TypeScript parser. Although we ultimately decided to go with the TypeScript parser, we would like to acknowledge and thank @marcesengel for their contributions. @all-contributors please add @marcesengel for code. I have decided to create a separate package, called next-translate-plugin, to handle the Webpack plugin functionality in the next-translate library. This decision was made to improve the overall performance and maintainability of the library. By separating the plugin functionality into its own package, we can ensure that it is only loaded during the build process and not included in the final bundle that is served to the client, reducing the final bundle size. Additionally, by listing it as a devDependency, it will be installed only in development environment and not in production. This also allows for better management of the plugin and its dependencies, and makes it easier to update or change in the future, if needed. For those interested, you can see the pull request for the changes here: #975 And the new package Thank you both again for your contributions and support in making this library better. And any feedback on the PR is very welcome 😊 |
Beta Was this translation helpful? Give feedback.
-
You can try it now in 2.0.0-canary.2. Requires
Now the next-translate size reduces it 😊 Less work for some pipelines 👍 |
Beta Was this translation helpful? Give feedback.
-
Babel
@marcesengel did a great contribution replacing all regular expressions to a babel parser #854 It is likely to solve many of the current issues and prevent future issues.
However, it is a big core change, and I propose to release it for version 2.0.0.
Currently prerelease to try: 2.0.0-experimental.1, please try it.
TypeScript compiler
Another Proposal by @StLyn4: TypeScript compiler:
PR: #913
Possible to try it in 2.0.0-experimental.3
I look forward to your feedback on these changes.
12 votes ·
Beta Was this translation helpful? Give feedback.
All reactions