Skip to content
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

Add package_name to ts_library so that module_name no longer enables linking #2450

Closed
gregmagolan opened this issue Feb 5, 2021 · 3 comments
Labels
Can Close? We will close this in 30 days if there is no further activity
Milestone

Comments

@gregmagolan
Copy link
Collaborator

This is a breaking change so needs to be sequenced with 4.0.

It will allow us to remove the __tslibrary__ special handling in internal/linker/link_node_modules.bzl:

``
# Special case for ts_library module_name for legacy behavior and for AMD name work-around
# Tag the mapping as "tslibrary" so it can be overridden by any other mapping if found.
#
# In short, ts_library module_name attribute results in both setting the AMD name (which
# desired and necessary in devmode which outputs UMD) and in making a linkable mapping. Because
# of this, you can get in the situation where a ts_library module_name and a downstream pkg_name
# package_name conflict and result in duplicate mappings. This work-around will make this
# situation work however it is not a recommended pattern since a ts_library can be a dep of a
# pkg_npm but not vice-verse at the moment since ts_library cannot handle directory artifacts as
# deps.
if hasattr(linkable_package_info, "_tslibrary") and linkable_package_info._tslibrary:
mr[0] = "tslibrary"

 ...

# Simplify mappings before writing them to the manifest file.
# The extra complication is required in bzl to handle the __tslibrary__ special
# case since module_name in ts_library enables the linker. In a future major release,
# ts_library will get a package_name attribute to enable the linker and the __tslibrary__
# special case can be factored out.
for k, v in mappings.items():
    mappings[k] = v[1]
@gregmagolan gregmagolan added this to the 4.0 milestone Feb 5, 2021
@github-actions
Copy link

github-actions bot commented May 7, 2021

This issue has been automatically marked as stale because it has not had any activity for 90 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs!

@github-actions github-actions bot added the Can Close? We will close this in 30 days if there is no further activity label May 7, 2021
@github-actions
Copy link

This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?"

@github-actions
Copy link

This issue was automatically closed because it went two weeks without a reply since it was labeled "Can Close?"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can Close? We will close this in 30 days if there is no further activity
Projects
None yet
Development

No branches or pull requests

1 participant