Skip to content

Conversation

devversion
Copy link
Member

@devversion devversion commented Jan 14, 2025

See individual commits (review per-commit ideally)

@angular-robot angular-robot bot added the area: build & ci Related the build and CI infrastructure of the project label Jan 14, 2025
/[email protected]:
resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==}
engines: {node: '>= 8'}
dev: true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These dependencies lost their dev status because packages/angular_devkit/core requires them as non-dev. Perfectly fine!

but this brings up a good future opportunity in ensuring the root package.json matches the dependencies in the "shipped package.json". cc. @clydin. I assume this would work if we could use pnpm for publishing as it would automatically e.g. replace workspace:XXX with the proper versions.

":node_modules/@angular-devkit/core",
"//:node_modules/@types/node",
"//:node_modules/rxjs",
"//packages/angular_devkit/core:core_rjs",
Copy link
Member Author

@devversion devversion Jan 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new npm-archive imports nicely prevent cross-relative imports (like we decided in MUC!). It also fixes/improves some .d.ts output generation where TS currently emits e.g. import('../core')

This is necessary as `rules_js` requires this "common name" when dealing
with Yarn workspaces, linking first party dependencies automatically.

In the future, we may be able to send a PR to `rules_js` to support a
custom name somehow.
@devversion devversion added action: review The PR is still awaiting reviews from at least one requested reviewer target: rc This PR is targeted for the next release-candidate labels Jan 15, 2025
This is necessary as with the new compilation, leveraging pnpm-linked
first party dependencies, there are cases **during migration** where
multiple locations of the same package exist. e.g.

- `@angular_devkit/architect/node_modules/@angular-devkit/core` (pnpm package output)
- `@angular_devkit/core` (plain js sources)

This is fine, and there is no risk of wrong types, and this should only
occur during migration anyway, but it causes a few type issues as
TypeScript is unable to emit proper types for inference. This is okay,
as we'd likely even want to make use of `isolatedDeclarations` at some
point, but we just add explicit types right now.

(also making `Builder` type more type safe, checking assignability
properly).
…les_js`

Instead of using `rules_nodejs` interop and the linker at runtime, the
test target is migrated to the new `jasmine_test` rule, leveraging the
pnpm workspace for first-party dependencies.

Note that in the future we may be able to rename the local node modules
to something more clear. e.g. `:local_modules/@angular-devkit/core`, but
for now this is not possible :(

This commit shows how similar packages can be migrated in the future.
@devversion devversion marked this pull request as ready for review January 15, 2025 15:16
}

export default createBuilder(buildApplication);
const builder: Builder<ApplicationBuilderOptions & json.JsonObject> =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const builder: Builder<ApplicationBuilderOptions & json.JsonObject> =
const builder: Builder<ApplicationBuilderOptions & import('@angular-devkit/core').json.JsonObject> =

I'd like to minimize the core package usage as much as possible here. I think this is as far as possible right now. Assuming it works with the other changes.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@devversion maybe we should switch to Type instead of Interface which would avoid the & json.JsonObject.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to be used throughout the repository, within the same builders. Are we good keeping as is and just leaving this to a general cleanup? (seems more work, even with Alan's idea; which seems to work; I'm not sure of the consequences and there would still be quite some cleanup work then)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with some TODOs here to cleanup later in the migration process.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline. TODO not necessary, but we'll track this in a separate issue as cleanup.

@devversion devversion added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Jan 15, 2025
@devversion devversion removed the request for review from alan-agius4 January 15, 2025 18:19
@devversion devversion added target: minor This PR is targeted for the next minor release and removed target: rc This PR is targeted for the next release-candidate labels Jan 15, 2025
@devversion devversion merged commit ac37218 into angular:main Jan 15, 2025
32 of 33 checks passed
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Feb 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants