This guide helps you migrate between major versions of Vinyl using automated migration scripts.
Install jscodeshift globally:
npm install -g jscodeshift
The quality accessor properties have been replaced with methods that accept a content type parameter:
Deprecated Properties:
player.streamingQualityplayer.bufferingQualityplayer.playbackQualityNew Methods:
player.getStreamingQuality(contentType: ContentType)player.getBufferingQuality(contentType: ContentType)player.getPlaybackQuality(contentType: ContentType)New Property:
player.contentTypes: ReadonlySet<ContentType> - The currently active types
of content streams.New Event:
contentTypesChange - Emitted when the available content types changeMigration Example:
// Before v0.24
const audioQuality = player.streamingQuality
const bufferingQuality = player.bufferingQuality
const playbackQuality = player.playbackQuality
// v0.24+
const audioQuality = player.getStreamingQuality('audio')
const videoQuality = player.getStreamingQuality('video')
const bufferingQuality = player.getBufferingQuality('audio')
const playbackQuality = player.getPlaybackQuality('audio')
// Get all available content types
const contentTypes = player.contentTypes // Set(['audio', 'video'])
The new API supports multiple content types (audio, video, text) instead of only returning audio quality.
This version renames several utility types for better consistency and moves
dependency injection functionality to a separate @amzn/vinyl-di package:
Package Changes:
Dependency injection moved from @amzn/vinyl-util to @amzn/vinyl-di:
DependencyProvider → FactoryDependencyFactories → FactoriesProvidedDependencies → DependenciesDependenciesContainer → ContainerValidDependencyFactories → ValidFactoriesValidDependencyProvider → ValidFactoryValidDependencyFactoryOverrides → ValidFactoryOverridesValidProviderDependencies → ValidFactoryDependenciescreateDependenciesContainer → createContainervalidateDependencyFactories → validateFactoriescreateVinylDependencyFactories → createVinylFactoriescreateVinylAmznDependencyFactories → createVinylAmznFactoriesType Renames:
DeepReadonly → ReadonlyDeepDeepReadonlyTupleOrArray → ReadonlyTupleOrArrayDeepDeepReadonlyArray → ReadonlyArrayDeepDeepReadonlyObject → ReadonlyObjectDeepDeepMutable → MutableDeepDeepMutableArray → MutableArrayDeepDeepMutableObject → MutableObjectDeepDeepMutableSet → MutableSetDeepEmptyObject → AnyRecordDeepOmit → OmitDeepDeepOptional → OptionalDeepDeepPartial → PartialDeepVinyl Refactors:
BufferingControllerOptions → BufferingControllerImplOptionsSegmentControllerInitOptions → SegmentControllerImplOptionsBufferingControllerDeps → BufferingControllerImplDepsSourceBufferControllerDeps → SourceBufferControllerImplDepsVinyl Amzn Refactors:
StreamingOptionsProvider → AmznStreamingOptionsProviderStreamingOptions → AmznStreamingOptionsMigration Command:
npx jscodeshift -t node_modules/@amzn/vinyl-amzn/migration/v0.23.js src/**/*.ts src/**/*.tsx