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

breaking-change: move ts-node from dependency to peer dependency #83

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

felipeplets
Copy link
Contributor

As ts-node is a dependency of ts-mocha it does not allow to use of newer versions of ts-node with it making dedupe and hoisting techniques hard to be applied.

@piotrwitek
Copy link
Owner

@felipeplets I was thinking about it but not everyone needs to install ts-node in their project, also it'll break existing user's projects, they will need to install manually ts-node to their projects with the appropriate version depending on their config and feature set, if they just install the most recent it will break their config right off the bat as v7 is not compatible with a newer version of ts-node.
Furthermore, it will break when a new version of ts-node is published that contain breaking changes thus adding a maintenance burden on the project.
Are any other alternative approaches that will make your use case work without breaking existing users' use cases?

@piotrwitek piotrwitek changed the title fix: move ts-node from dependency to peer dependency breaking: move ts-node from dependency to peer dependency Mar 9, 2023
@piotrwitek piotrwitek changed the title breaking: move ts-node from dependency to peer dependency breaking-change: move ts-node from dependency to peer dependency Mar 9, 2023
@piotrwitek
Copy link
Owner

piotrwitek commented Mar 27, 2023

I know the general idea behind this change but I would like to understand a real-world example of why this change is necessary now and why it was never reported by anyone before. The biggest concern I'm worried about is I don't want to introduce unneeded changes to the users if it was working fine so far.

@felipeplets
Copy link
Contributor Author

it will break their config right off the bat as v7 is not compatible with a newer version of ts-node.
I tried it with different versions from v7 to v10 and couldn't find any issues between those versions. Do you know what specifically would break?

The problem I am facing is that we are reducing (deduping and hosting) dependencies installed in a large project. Big part is reducing dev tools like typescript, ts-node, mocha, etc... some dependencies have hard dependencies like ts-mocha which make it impossible to not have ts-node v7 installed.

Most other dev tools solve the problem of compatibility by using peerDependencies which we already do. So basically we are saying with the peerDependencies that ts-mocha works with any version from v7 to v10 of ts-node (I tested and it seems true) but we actually force the installation of v7. So we are taking away the control from the library user to define any ts-node in that range.

Let's say ts-node v11 is released, the package manager will warn the user they are breaking that based on peerDependencies, but they can still do at their own risk. If it break we can point users to the requirements and the warning educating them about that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants