amplitude / amplitude/Amplitude-TypeScript

Types exports in @amplitude/analytics-types are out of date

Ouverte
#1,524 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub
bug
Langage dominant
TypeScript
Étoiles
180
Forks
68
Merge moyen
3 j 1 h
PR mergées (30 j)
29

Description

## Expected Behavior
Expect that `@amplitude/analytics-types` exports match the current functionalities found in other packages. Example: `AutocaptureOptions` should have `webVitals`, which is properly exported in `@amplitude/analytics-core`.

If this package is deprecated or on the way to being deprecated, other packages need to export the types that are currently exported in `@amplitude/analytics-types`. Example: `ValidPropertyType` is exported by the types package, but not from `@amplitude/analytics-core` even though [that type is redefined in that package](https://github.com/amplitude/Amplitude-TypeScript/blob/3a3818d19bd84e4aa8405e10f8538886dd647f38/packages/analytics-core/src/identify.ts#L121).

## Current Behavior
To use modern features and keep proper typing, now multiple packages with identically named exported types need to be imported to get the correct types.

## Possible Solution

## Steps to Reproduce
1. npm i @amplitude/analytics-types@2.11.1 @amplitude/analytics-browser@2.34.0
2. In a TS file:
```
import type { AutocaptureOptions } from '@amplitude/analytics-types';
const autocaptureOptions: AutocaptureOptions = {
attribution: true,
webVitals: true,
};
```
3. Type error: `webVitals` does not exist in type `AutocaptureOptions`

## Environment
- JS SDK Version: 2.34.0
- Installation Method: npm
- Browser and Version: N/A

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.