-
Notifications
You must be signed in to change notification settings - Fork 468
Support Yarn-pnp, esy, and npm-link #3276
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
Comments
Keeping notes as I look. AFAIK the main change needs to happen in |
The manifest file appears resolved by yarnpkg/yarn#6388 (comment). |
Is there anything a newcomer like me can do to help this gain some traction? Where should I look to get started? |
Hi, pushing this up. Yarn Berry, the next version of Yarn is moving fast and gaining traction. TS and all major Js tooling support this already. can we push this higher? |
It's gone awfully quiet in here.... Has this been dropped, or just greatly deprioritised? I didn't even know it was a problem until I started a project with Yarn 2, and wondered why nothing was working, so at least add a warning to the Rescript docs. |
@chriswilty have you seen https://github.com/reason-seoul/yarn-plugin-rescript/ ? I think it should be mentioned in the docs somewhere, it is still completely new though. |
I agree to the assumption that node_modules exists is wrong, but this is too pervasive. So even the Yarn PnP's approach is better than node_modules, in reality there are many problems with adaptation and that why node_modules linker exist. What I did in yarn-plugin-rescript was to provide a compatibility layer. I'm thinking if it's possible in other places in a similar way. |
Is this issue still on the map? |
This follows the instructions from https://yarnpkg.com/getting-started/migration It ensures we keep using node_modules and don't use Plug 'n Play since ReScript doesn't support PnP yet. See rescript-lang/rescript#3276 Yarn 3 provides us some better tools for working with monorepo's. For example it allows us to reference a consistent version throughout the workspace.
This follows the instructions from https://yarnpkg.com/getting-started/migration It ensures we keep using node_modules and don't use Plug 'n Play since ReScript doesn't support PnP yet. See rescript-lang/rescript#3276 Yarn 3 provides us some better tools for working with monorepo's. For example it allows us to reference a consistent version throughout the workspace.
* Upgrade to Yarn 3 This follows the instructions from https://yarnpkg.com/getting-started/migration It ensures we keep using node_modules and don't use Plug 'n Play since ReScript doesn't support PnP yet. See rescript-lang/rescript#3276 Yarn 3 provides us some better tools for working with monorepo's. For example it allows us to reference a consistent version throughout the workspace. * Upgrade Yarn lock file to version 3 * Make `run-s` syntax Yarn 3 compatible Yarn 3 includes a built in interpreter so we must quote the glob expression. * Update from `--frozen-lockfile` to `--immutable` The flag has been split out into `--immutable` and `--immutable-cache` in Yarn 3. We don't commit the caache so we use the former. * Disable CI install cache for yarn upgrade
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. |
This is still an issue. It would be nice if rewatch could addressed this... |
Yes I agree with rewatch we can probably finally tackle this. |
You are probably looking for another Jaap. ;) |
Sorry! @jfrolich |
The following workflows and package managers don't work when tools build into node_modules directories, or rely on dependencies existing in node_modules.
Because of this, developers building native apps with
esy
cannot use bs-platform at all. They have very frequently requested the ability to useesy
to build bs apps, but there's not much esy can do at this point, and the solution to esy is the same as the solution to yarn pnp and npm link, so might as well solve all three at once.esy
used to manage JS dependencies (uses yarn plugin'n'play standard).Here's what I believe needs to happen to make bs-platform work with all three of these. The solutions are largely the same for all use cases:
Stop Building Into Dependencies'
node_modules
The idea here is that all libraries should be built into the top level project's root directory. Separate Tracking Issue
Don't assume dependencies even exist in
node_modules
.Since esy and yarn both never touch the disk if it can read the dependencies from an immutable cache, we can't assume the packages are located at
node_modules
. Instead yarn pnp generates a.pnp.js
and esy generates a./_esy/default/pnp.js
file. That tells you the real locations of dependencies in the immutable cache. Esy uses the exact same pnp standard, but we can make some changes if it makes it easier for you.Optimization: Yarn pnp requires starting up a JS VM to determine the location of dependencies. I believe we can make esy's
pnp.js
file carefully constructed so that bsb could just read the locations directly from the text file by parsing simple strings instead of starting a JS VM. It would also work if you started it up with a JS VM but we can overlay an additional protocol on top of yarn pnp for the sake of additional performance.Avoid postinstall for bs-platform's installation.
Model compiler explicitly:
This one is only relevant for esy. But if there is an esy.json file alongside package.json for bs-platform, which expresses the dependency on the ocaml compiler it uses, and its version, then esy could be used to install native ocaml ppx's for BuckleScript projects.
The text was updated successfully, but these errors were encountered: