rescript-lang / rescript-compiler

The compiler for ReScript.
https://rescript-lang.org
Other
6.75k stars 449 forks source link

[Feature] Make bsb watcher to also watch symlinks in node_modules #3521

Closed jchavarri closed 1 year ago

jchavarri commented 5 years ago

In Yarn workspaces, shared deps are "hoisted" to a parent folder. Workspaces are symlinked like.

Let's say I am working in a monorepo with two Yarn workspaces, package-1 and package-2, each one with their own bsconfig.json (image source):

image

If package-1 depends on package-2 there is no way at the moment (that I know of) to run bsb -w from package-1 folder, and have the compiler pick up the changes on package-2.

I was thinking if the watcher could somehow detect if the folder in node_modules is a symlink, and in that case watch for changes in it as well?

justgage commented 5 years ago

Would this happen even if it's not in a monorepo?

cknitt commented 5 years ago

👍 This would be absolutely great to have!

Our use case is a yarn workspaces monorepo with the following packages:

with both A and B depending on C.

Currently, when running bsb -w in A or B, changes in C are not picked up.

Coobaha commented 5 years ago

Any plans on this @bobzhang?

I've also noticed that if you are building multiple apps that are sharing same symlinked package bs will warn about package name duplicates and that first one was picked.

Another issue is parallel builds with shared packages. They are not possible because of race conditions, we are using concurrency 1 everywhere.

Coobaha commented 5 years ago

Sorry for bumping this again, but this is very very annoying with mono repo setups :/ will this issue be prioritised at some point?

bobzhang commented 5 years ago

Note @Coobaha raised several separate issues, watching dependent packages and shared packages

cknitt commented 5 years ago

@bobzhang Would you like me to provide an example repo with a monorepo setup as described above?

Coobaha commented 4 years ago

Very naive implementation https://github.com/BuckleScript/bucklescript/pull/4047 should add symlinks to watch list

BlueHotDog commented 4 years ago

Adding to the request queue. monorepos have a lot of benefits for modern web development. Any kind of guidance would be appreciated, I'm happy to pitch in but no idea why this doesn't work. @bobzhang any clue as to when this will be fixed?

BlueHotDog commented 4 years ago

Looks like it works on bs 8. @jchavarri maybe close?

fhammerschmidt commented 4 years ago

@BlueHotDog Do you have a working sample repo, by any chance?

BlueHotDog commented 4 years ago

Actually, on second check, it still doesnt work :(((( but, it does behave a bit better.

BlueHotDog commented 4 years ago

Also this: Trying to run yarn in a yarn workspace monorepo getting crypting errors. Please Please Please - how can we make monorepo usable?

Error: https://gist.github.com/BlueHotDog/e70733c751e69a802570e08f3bf773cb

Thanks.

BlueHotDog commented 3 years ago

isnt this closed/fixed by pinned-deps thingie?

Freddy03h commented 3 years ago

Nope https://github.com/rescript-lang/rescript-compiler/issues/4361#issuecomment-753370902

stale[bot] commented 1 year ago

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.

Freddy03h commented 1 year ago

😞

fhammerschmidt commented 1 year ago

If this does not get reopened, I still want to reference https://github.com/rescript-lang/rescript-compiler/issues/6248 here so that it does not get forgotten.