facebook / facebook/relay

make relay compiler dependency smaller

Open
#4,541 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
19k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

Checking the size of relay-compiler in the node_modules

```bash
du -hcd1 node_modules/relay-compiler | sort -h
```

```
15M node_modules/relay-compiler/win-x64
17M node_modules/relay-compiler/macos-arm64
17M node_modules/relay-compiler/macos-x64
26M node_modules/relay-compiler/linux-arm64
27M node_modules/relay-compiler/linux-x64
101M node_modules/relay-compiler
101M total
```

we can see it is installing all bindings to all arch

One possible solution is to have something like @rspack/bindings, and use optionalDependencies

https://github.com/web-infra-dev/rspack/blob/ff20da9ad3ddcae1addf41a31d8b2b22d1c15a06/crates/node_binding/package.json#L38

```
"optionalDependencies": {
"@rspack/binding-darwin-arm64": "workspace:*",
"@rspack/binding-darwin-x64": "workspace:*",
"@rspack/binding-linux-x64-gnu": "workspace:*",
"@rspack/binding-win32-x64-msvc": "workspace:*"
}
````

So you only install the package related to the platform

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.