Convert project to TypeScript
See original GitHub issueHi 👋 ,
I was about to create a draft PR but I’ve noticed you’ve merged my fork into a new branch. I’ve created this issue to give you a heads up and also a run down of the changes.
Heads up:
I’m waiting on a new release from plyr
since I fixed a type issue yesterday. Also, I’m still testing this is in a Next.js project so I’ll let you know if everything works on my end.
The rundown:
- The project is written in Typescript and uses the types from the official repo. Fixes #201
plyr-react
was not Next.js friendly since it imported the css styles within the component and that is no longer supported. Users will need to import the styles manually. Fixes #162- The component separates the
source
prop fromoptions
prop since originalOptions
type does not includesource
. - Configuration files are simplified. It’s best to keep things simple but feel free to change it.
Thank you.
Update
Plyr
seems to work correctly with the latest version of Next.js.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Documentation - Migrating from JavaScript - TypeScript
If you're looking to convert a React project, we recommend looking at the React Conversion Guide first. Setting up your Directories. If you're...
Read more >Converting a Javascript project to Typescript - Medium
You can do so by running the following command in the root directory of your project. npm install --save-dev typescript ts-loader. Step 2: ......
Read more >Converting JavaScript to TypeScript - TutorialsTeacher
Converting Existing JavaScript to TypeScript · Add tsconfig.json file to project · Integrate with a build tool · Change all .js files to...
Read more >8 Tips for Converting That Big Project to TypeScript
The hybrid method allows your team to migrate to TypeScript without stopping the development process. Use the allowJs compiler option to add new ......
Read more >How to Migrate Application From JavaScript to TypeScript
TypeScript is a superset of JavaScript, so valid JavaScript code is a valid TypeScript code. Incremental migration, converting the whole project step by...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@iwatakeshi Done
The PR has already been merged. I’m not sure if @chintan9 wants to make the changes I’ve mentioned here, but if he does then that’s all that needs to be done…I think.
@chintan9 You could publish the package as
alpha
and see if things work, even though we’re waiting on a newPlyr
release. You’ll just have to add to the docs that the types forSource
is incorrect so the developer needs to useany
to remove the warnings:Maybe the one thing that comes to mind is that
Plyr
(the package) is globally available and therefore shadows the component’s type def (Plyr
), I’m thinking we should add a new type def (plyr.d.ts
orreact-plyr.d.ts
) that looks something like this:Then, just change the
types
property inpackage.json
to point to that file… I think.I’ll leave it up to you to decide.