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
adev: Local packages not linked properly for development #54858
Comments
This is probably related, I've noticed that the ADEV app is not build against the local packages. See #55161 where I had to rely on a temporary patch-package to fix an issue which was already fixed locally. |
Yeah, the packages are not picked up and this makes it difficult to also use new compiler features in |
I believe this would also fix issues like:
where the angular-devkit accidentally sees |
There is quite some trickery going on with the adev build related to local packages: - Adev builds using npm packages from `/node_modules` - At runtime, we are adding `HEAD` packages for e.g. `@angular/core` to the bundles. - At build time, the CLI, or Angular devkit may accidentally resolve to `@angular/core` from `/node_modules/`— which is the core version from npm, transitively installed via `@angular/docs`. This causes a version mismatch, leading to issues like: - CLI throwing because of a mismatch. angular#54858 (comment) - Compiler changes not being picked up. angular#54858 (comment) This commit attempts to fix this by: - Linking all Angular `HEAD` packages into `adev/node_modules`. The current logic attempts to link into `/node_modules`, but this does not override existing `@angular/core`! - Linking all direct external NPM packages, like `@angular_devkit/build-angular` into `adev/node_modules` without their transitive deps. This allows proper resolution of e.g. compiler as node looks in `adev/node_modules` first, and falls back for the rest to the execroot `node_modules`, or symlink target destination (if `preserveSymlinks=false`). Note: This is still not 100% ideal because a direct external NPM dependency may have a transitive dependency that has another transitive dependency on `@angular/core`. In those cases, the may be a conflict that is not resolvable until we switch to a Bazel toolchain with better first party resolution support.
There is quite some trickery going on with the adev build related to local packages: - Adev builds using npm packages from `/node_modules` - At runtime, we are adding `HEAD` packages for e.g. `@angular/core` to the bundles. - At build time, the CLI, or Angular devkit may accidentally resolve to `@angular/core` from `/node_modules/`— which is the core version from npm, transitively installed via `@angular/docs`. This causes a version mismatch, leading to issues like: - CLI throwing because of a mismatch. angular#54858 (comment) - Compiler changes not being picked up. angular#54858 (comment) This commit attempts to fix this by: - Linking all Angular `HEAD` packages into `adev/node_modules`. The current logic attempts to link into `/node_modules`, but this does not override existing `@angular/core`! - Linking all direct external NPM packages, like `@angular_devkit/build-angular` into `adev/node_modules` without their transitive deps. This allows proper resolution of e.g. compiler as node looks in `adev/node_modules` first, and falls back for the rest to the execroot `node_modules`, or symlink target destination (if `preserveSymlinks=false`). Note: This is still not 100% ideal because a direct external NPM dependency may have a transitive dependency that has another transitive dependency on `@angular/core`. In those cases, the may be a conflict that is not resolvable until we switch to a Bazel toolchain with better first party resolution support.
There is quite some trickery going on with the adev build related to local packages: - Adev builds using npm packages from `/node_modules` - At runtime, we are adding `HEAD` packages for e.g. `@angular/core` to the bundles. - At build time, the CLI, or Angular devkit may accidentally resolve to `@angular/core` from `/node_modules/`— which is the core version from npm, transitively installed via `@angular/docs`. This causes a version mismatch, leading to issues like: - CLI throwing because of a mismatch. angular#54858 (comment) - Compiler changes not being picked up. angular#54858 (comment) This commit attempts to fix this by: - Linking all Angular `HEAD` packages into `adev/node_modules`. The current logic attempts to link into `/node_modules`, but this does not override existing `@angular/core`! - Linking all direct external NPM packages, like `@angular_devkit/build-angular` into `adev/node_modules` without their transitive deps. This allows proper resolution of e.g. compiler as node looks in `adev/node_modules` first, and falls back for the rest to the execroot `node_modules`, or symlink target destination (if `preserveSymlinks=false`). Note: This is still not 100% ideal because a direct external NPM dependency may have a transitive dependency that has another transitive dependency on `@angular/core`. In those cases, the may be a conflict that is not resolvable until we switch to a Bazel toolchain with better first party resolution support.
There is quite some trickery going on with the adev build related to local packages: - Adev builds using npm packages from `/node_modules` - At runtime, we are adding `HEAD` packages for e.g. `@angular/core` to the bundles. - At build time, the CLI, or Angular devkit may accidentally resolve to `@angular/core` from `/node_modules/`— which is the core version from npm, transitively installed via `@angular/docs`. This causes a version mismatch, leading to issues like: - CLI throwing because of a mismatch. #54858 (comment) - Compiler changes not being picked up. #54858 (comment) This commit attempts to fix this by: - Linking all Angular `HEAD` packages into `adev/node_modules`. The current logic attempts to link into `/node_modules`, but this does not override existing `@angular/core`! - Linking all direct external NPM packages, like `@angular_devkit/build-angular` into `adev/node_modules` without their transitive deps. This allows proper resolution of e.g. compiler as node looks in `adev/node_modules` first, and falls back for the rest to the execroot `node_modules`, or symlink target destination (if `preserveSymlinks=false`). Note: This is still not 100% ideal because a direct external NPM dependency may have a transitive dependency that has another transitive dependency on `@angular/core`. In those cases, the may be a conflict that is not resolvable until we switch to a Bazel toolchain with better first party resolution support. PR Close #55282
There is quite some trickery going on with the adev build related to local packages: - Adev builds using npm packages from `/node_modules` - At runtime, we are adding `HEAD` packages for e.g. `@angular/core` to the bundles. - At build time, the CLI, or Angular devkit may accidentally resolve to `@angular/core` from `/node_modules/`— which is the core version from npm, transitively installed via `@angular/docs`. This causes a version mismatch, leading to issues like: - CLI throwing because of a mismatch. #54858 (comment) - Compiler changes not being picked up. #54858 (comment) This commit attempts to fix this by: - Linking all Angular `HEAD` packages into `adev/node_modules`. The current logic attempts to link into `/node_modules`, but this does not override existing `@angular/core`! - Linking all direct external NPM packages, like `@angular_devkit/build-angular` into `adev/node_modules` without their transitive deps. This allows proper resolution of e.g. compiler as node looks in `adev/node_modules` first, and falls back for the rest to the execroot `node_modules`, or symlink target destination (if `preserveSymlinks=false`). Note: This is still not 100% ideal because a direct external NPM dependency may have a transitive dependency that has another transitive dependency on `@angular/core`. In those cases, the may be a conflict that is not resolvable until we switch to a Bazel toolchain with better first party resolution support. PR Close #55282
…lar#55282) There is quite some trickery going on with the adev build related to local packages: - Adev builds using npm packages from `/node_modules` - At runtime, we are adding `HEAD` packages for e.g. `@angular/core` to the bundles. - At build time, the CLI, or Angular devkit may accidentally resolve to `@angular/core` from `/node_modules/`— which is the core version from npm, transitively installed via `@angular/docs`. This causes a version mismatch, leading to issues like: - CLI throwing because of a mismatch. angular#54858 (comment) - Compiler changes not being picked up. angular#54858 (comment) This commit attempts to fix this by: - Linking all Angular `HEAD` packages into `adev/node_modules`. The current logic attempts to link into `/node_modules`, but this does not override existing `@angular/core`! - Linking all direct external NPM packages, like `@angular_devkit/build-angular` into `adev/node_modules` without their transitive deps. This allows proper resolution of e.g. compiler as node looks in `adev/node_modules` first, and falls back for the rest to the execroot `node_modules`, or symlink target destination (if `preserveSymlinks=false`). Note: This is still not 100% ideal because a direct external NPM dependency may have a transitive dependency that has another transitive dependency on `@angular/core`. In those cases, the may be a conflict that is not resolvable until we switch to a Bazel toolchain with better first party resolution support. PR Close angular#55282
Unlike with
aio
,adev
only links top-level@angular/
packages to their npm archives fromHEAD
. Transitive dependencies are not properly updated, like we do for AIO— this means thatadev
may run with older versions of the Angular compiler because e.g. the CLI devkit would have their own transitive dependency.This can cause subtle build issues when making changes in the compiler. We should investigate if this is still needed, but not throw away the effort put into AIO:
angular/aio/local_packages_util.bzl
Lines 15 to 25 in 700c052
Additional context: 6cc3256
The text was updated successfully, but these errors were encountered: