-
-
Notifications
You must be signed in to change notification settings - Fork 156
refactor: add simplified package store definition for no-hook non-circular packages #2557
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
base: 3.x
Are you sure you want to change the base?
Conversation
|
be977b9 to
bd92bcb
Compare
npm/private/npm_import.bzl
Outdated
| ) | ||
|
|
||
| # reference target used when referenced by a package with cycles | ||
| _npm_package_store( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One reason to create npm_imported_simple_package_store_internal... if we can determine that this package is never part of a circular dep then /ref and /pkg can either be omitted or maybe alias()s to the main target (we do aliases for local package store entries already - or we can have a breaking change to no longer guarantee these targets exist).
That will be a followup...
bd92bcb to
d6599b4
Compare
| exclude_package_contents): | ||
| bazel_package = native.package_name() | ||
| is_root = bazel_package == root_package | ||
| if not is_root: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This macro is only invoked from generated code where we already checked this, so I'm deleting it instead of duplicating it again into the new macro.
d6599b4 to
d5cb56d
Compare



Add a simplified codepath (
npm_imported_simple_package_store_internal) for packages with no circular deps and no lifecycle hooks. While it adds a bit of code it makes the most common scenario much simpler to follow.Changes are visible to end-users: no
Test plan