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

feat(FEC-13371): Refactor: Transitioning from Flow to TypeScript #661

Merged
merged 71 commits into from
Dec 28, 2023

Conversation

JonathanTGold
Copy link
Contributor

@JonathanTGold JonathanTGold commented Oct 18, 2023

Description of the Changes

Refactor: Transitioning from Flow to TypeScript

solves FEC-13371

Refactoring Summary:

  • TypeScript Adoption

    • Transitioned from Flow to TypeScript
  • Build/Compiler Configuration

    • Implemented dual Compiler/build/target configurations for different build targets.
    • development: focuses on keeping up with new and modern (ESModule / TypeScript) standard - compiled by TypeScript compiler and targeted to ''ESNext' managed via the tsconfig.json file
    • production: focuses on old Browser support compatibility - compiled by webpack, babel and browserstack managed via the webpack.config file
  • Streamlining Types

    • Synchronized types across all dependencies to ensure consistency.
    • Mapped missing types.
    • Removed duplicate types,
    • placing each in its respective repository.
    • Exported types as declarations for cleaner, more reusable code.
  • Aligning with new syntax

    • Transforming old syntax into ECMAScript equivalent
  • Remove polyfills

    • Remove polyfills library
    • Remove our polyfills code for some API (such as VTT)
  • Upgrading Dependencies

    • Removed unnecessary dependencies for a leaner, more secure codebase
    • Updated existing ones for a leaner, more secure codebase..
  • Automating TS declarations

    • Using automating tool to auto-generating TypeScript declarations ready for export as npm module
  • Upgrading webpack

    • Refactoring webpack deps and configurations to align with latest tech and gain more faster secured and efficient builds
  • Browsers Targets - Management

    • Achieved consistent browser targets across repositories using Babel and Browserlist, with plans for future automation.
    • Consistency (across all core dpes and plugins repos)
    • Shareable config (across all core dpes and plugins repos)
  • Removing dist folder

    • using the NPM as our source for artifacts

Bundles size effects:

(assuming removing old browsers target support - not imlemented yet)

Asset Name Before After
kaltrua-player-js 1.74 MiB 1.59 MiB
playkit-js 204 KiB 179 KiB
playkit-js-ui 471 KiB 409 KiB
playkit-js-dash 40.5 KiB 32.8 KiB
playkit-js-hls 26.3 KiB 24.7 KiB
providers / playkit-ovp-provider 49.2 KiB 36.4 KiB
providers / playkit-ott-provider 31.4 KiB 21.9 KiB
providers / playkit-analytics-service 10.5 KiB 7.55 KiB
providers / playkit-bookmark-service 9.17 KiB 6.89 KiB
providers / playkit-stats-service 9.82 KiB 6.89 KiB
shaka-player 509 KB unchanged
hls.js 375 KB unchanged

Related PRs

kaltura/playkit-js#726
kaltura/playkit-js-providers#225
kaltura/playkit-js-dash#254
kaltura/playkit-js-hls#213
kaltura/playkit-js-ui#815
https://github.com/kaltura/playkit-js-browserslist-config/pull/1

@JonathanTGold JonathanTGold self-assigned this Dec 16, 2023
.eslintrc Outdated Show resolved Hide resolved
browserslist-config/index.js Outdated Show resolved Hide resolved
browserslist-config/package.json Outdated Show resolved Hide resolved
.eslintrc Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/ovp/poster.ts Outdated Show resolved Hide resolved
src/types/utils/deferred-promise.ts Outdated Show resolved Hide resolved
tests/index.js Outdated Show resolved Hide resolved
src/common/cuepoint/cuepoint-manager.ts Outdated Show resolved Hide resolved
src/index.ts Show resolved Hide resolved
JonathanTGold added 5 commits December 28, 2023 14:29
# Conflicts:
#	dist/kaltura-ovp-player.cjs.js
#	dist/kaltura-ovp-player.cjs.js.map
#	dist/kaltura-ovp-player.js
#	dist/kaltura-ovp-player.js.map
#	dist/kaltura-tv-player.cjs.js
#	dist/kaltura-tv-player.cjs.js.map
#	dist/kaltura-tv-player.js
#	dist/kaltura-tv-player.js.map
#	package.json
#	yarn.lock
@kaltura kaltura deleted a comment from semarche-kaltura Dec 28, 2023
@JonathanTGold JonathanTGold merged commit 4ba0ded into master Dec 28, 2023
11 checks passed
@JonathanTGold JonathanTGold changed the title feat(FEC-13371): Refactor: Migrate Kaltura Player to TypeScript (from Flow) feat(FEC-13371): Refactor: Transitioning from Flow to TypeScript Jan 14, 2024
@JonathanTGold JonathanTGold added Priority: High Type: Maintenance dependencies Pull requests that update a dependency file labels Jan 14, 2024
borhandarabi pushed a commit to TasvirChi/playchi-js-dash that referenced this pull request May 14, 2024
Refactor: Migrate to TypeScript (from Flow)

Related PRs
kaltura/kaltura-player-js#661
kaltura/playkit-js#726
kaltura/playkit-js-providers#225
kaltura/playkit-js-ui#815
kaltura/playkit-js-hls#213
kaltura/playkit-js-browserslist-config#1

solves FEC-13371

---------

Co-authored-by: JonathanTGold <[email protected]>
borhandarabi pushed a commit to TasvirChi/playchi-js-hls that referenced this pull request May 14, 2024
Refactor: Migration to TypeScript'

Related PRs
kaltura/kaltura-player-js#661
kaltura/playkit-js#726
kaltura/playkit-js-providers#225
kaltura/playkit-js-dash#254
kaltura/playkit-js-ui#815
kaltura/playkit-js-browserslist-config#1

solves FEC-13371


Co-authored-by: JonathanTGold <jonathan.gold@[email protected]>
borhandarabi pushed a commit to TasvirChi/playchi-js-providers that referenced this pull request May 14, 2024
Refactor: Migration to TypeScript'

solves FEC-13371

Related PRs
kaltura/kaltura-player-js#661
kaltura/playkit-js#726
kaltura/playkit-js-hls#213
kaltura/playkit-js-dash#254
kaltura/playkit-js-ui#815
kaltura/playkit-js-browserslist-config#1

Co-authored-by: JonathanTGold <jonathan.gold@[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file Priority: High Type: Maintenance
Development

Successfully merging this pull request may close these issues.

3 participants