should paraglide-js avoid compiling into node_modules? #1579
Replies: 5 comments 4 replies
-
This should make it way easier to integrate with various bundlers and having a generated folder that is gitignored is really not that big of a deal these days. |
Beta Was this translation helpful? Give feedback.
-
I generally agree with this out of various reasons namely that it reduced unexpected bugs & is something the user would more likely expect. Talking about expectations:
Paraglide JS CLI will then become a simple --project path --import path --output path. No namespacing no nothing. Import is even optional cuz can be obtained from project.inlang.json. This will probably eliminate 99.9% of bugs. Point being: If we allow this, people will going to love it, because it doesn't feel alien anymore "oh this paraglide thing" but more "oh my i18n setup". |
Beta Was this translation helpful? Give feedback.
-
Since there was already a big confusion around namespaces I would be happy to see this removed. |
Beta Was this translation helpful? Give feedback.
-
Paraglide is definitely not the only one, vite, turborepo, vitest, etc use node_modules as a place to store cached files. It might even eliminate the need to restart ts server or reload window after updating messages and vite caching the messages, preventing them from being updated. Also some might prefer to commit the generated code to the repository, to reduce the amount of scripts necessary to run every time you pull from the remote. |
Beta Was this translation helpful? Give feedback.
-
implemented |
Beta Was this translation helpful? Give feedback.
-
Vote with 👍 or 👎
Problem
The majority/all JS tooling default assumes that code in
node_modules
is static. Paraglide's compilation into node_modules breaks that assumption, leading to bugs that are fixed with workarounds.Proposal
Don't compile into node_modules. Instead, compile into the source code itself with a git ignore.
Pros
Neutral
@inlang/paraglide-js/{name}/messages
; imports will differ per user (but it's just normal JS after all!))Cons
CleanShot.2023-11-02.at.16.37.28.mp4
Beta Was this translation helpful? Give feedback.
All reactions