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

deps: upgrade tslib to ^2.4.0, remove @yarn-tool/resolve-package #326

Merged

Conversation

agilgur5
Copy link
Collaborator

@agilgur5 agilgur5 commented May 14, 2022

Summary

Resolves #286 in a simpler way by upgrading tslib instead of introducing any new deps

Implements the approach I proposed in #286 (comment)

Details

  • tslib 2.4.0 is forward and backward-compatible with older and newer Node exports mechanisms, so the Node 17 error should no longer be present

  • this allows us to remove the extra dep on @yarn-tool/resolve-package as well

  • test: add a small unit test for tslib.ts to ensure that this method works and passes on different Node versions in CI

    • more a smoke test that it runs at all, the testing is additional and a bit duplicative of the source tbh

- tslib 2.4.0 is forward and backward-compatible with older and newer
  Node exports mechanisms, so the Node 17 error should no longer be
  present
  - it has the older `./` and the newer `./*` in its package exports,
    which should allow for `package.json` to be read in both older and
    newer implementations

- this allows us to remove the extra dep on `@yarn-tool/resolve-package`
  as well
  - other than less unnecessary deps being good,
    `@yarn-tool/resolve-package` is also a not well-documented package
    with very few users, which does not make for a good security posture
    for rpt2 (which has historically prioritized supply chain security
    in other issues around deps) or, in particular, its consumers, which
    there are very many of (in contrast with `@yarn-tool`)
  - per my issue comment, we could also have avoided the extra dep prior
    to the tslib upgrade by resolving to absolute paths, as Node only
    does a "weak" encapsulation of relative imports

- test: add a small unit test for tslib.ts to ensure that this method
  works and passes on different Node versions in CI
  - more a smoke test that it runs at all, the testing is additional
    and a bit duplicative of the source tbh
@agilgur5 agilgur5 added scope: dependencies Issues or PRs about updating a dependency scope: tests Tests could be improved. Or changes that only affect tests labels May 14, 2022
@agilgur5 agilgur5 force-pushed the deps-upgrade-tslib-remove-yarn-tool branch from d52e27c to 189aaa5 Compare May 14, 2022 15:45
@agilgur5
Copy link
Collaborator Author

agilgur5 commented May 14, 2022

Tests pass on all Node versions, and I temporarily added a commit with passing tests to check Node 17 specifically as well.

@ezolenko ezolenko merged commit 60f3489 into ezolenko:master May 16, 2022
@agilgur5 agilgur5 added the kind: internal Changes only affect the internals, and _not_ the public API or external-facing docs label May 26, 2022
@agilgur5 agilgur5 deleted the deps-upgrade-tslib-remove-yarn-tool branch July 2, 2023 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: internal Changes only affect the internals, and _not_ the public API or external-facing docs scope: dependencies Issues or PRs about updating a dependency scope: tests Tests could be improved. Or changes that only affect tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node v17: Error loading tslib helper library
2 participants