This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
Reinstate Posthog analytics PR fixing type definitions via installing dev dependencies #6532
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Part of the previous PR for posthog #6495 included overriding posthog's type definitions to remove references to transitive dependencies which we don't use and don't want to install. This was done via a
paths
entry intsconfig.json
.This caused element-web linting to fail as EW's type linting descends into matrix-react-sdk but the override didn't apply to EW as no changes were made to its respective
tsconfig.json
. So I reverted the PR in #6531.It wouldn't be great for every Typescript user of
matrix-react-sdk
to have to do that.In this PR, I initially took a different approach suggested by @Palid - use
patch-package
to autopatch the library on postinstall. Unfortunately, as noted in the comments, we disable the postinstall hook in CI, and it would be awkward to work around that.I considered forking the library, but we don't currently maintain any forked dependencies and it seems silly to start doing that now for this one.
So for the time being, we are just going to install the libraries referred to as dev dependencies. We will be using Sentry shortly anyway. Flagged with posthog maintainers at PostHog/posthog-js#252