<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chintan prajapati</title>
    <description>The latest articles on DEV Community by Chintan prajapati (@chintan121).</description>
    <link>https://dev.to/chintan121</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F59860%2F590ccc29-5493-4256-934b-aebcaea99cd9.jpeg</url>
      <title>DEV Community: Chintan prajapati</title>
      <link>https://dev.to/chintan121</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chintan121"/>
    <language>en</language>
    <item>
      <title>🚀 Stop Killing Your Bundle Size</title>
      <dc:creator>Chintan prajapati</dc:creator>
      <pubDate>Fri, 26 Dec 2025 01:11:26 +0000</pubDate>
      <link>https://dev.to/chintan121/stop-killing-your-bundle-size-nnd</link>
      <guid>https://dev.to/chintan121/stop-killing-your-bundle-size-nnd</guid>
      <description>&lt;h2&gt;
  
  
  Automatically Remove Barrel Files in TypeScript
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1555099962-4199c345e5dd%3Fixlib%3Drb-4.0.3%26auto%3Dformat%26fit%3Dcrop%26w%3D1000%26q%3D80" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fimages.unsplash.com%2Fphoto-1555099962-4199c345e5dd%3Fixlib%3Drb-4.0.3%26auto%3Dformat%26fit%3Dcrop%26w%3D1000%26q%3D80" alt="Cover Image Description: A split screen showing a heavy, tangled bundle on the left and a clean, direct import structure on the right." width="1000" height="667"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;We all love &lt;strong&gt;Barrel Files&lt;/strong&gt; (&lt;code&gt;index.ts&lt;/code&gt; files that export everything from a directory). They make our imports look clean and organized:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// 😍 Looks clean...&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Header&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Footer&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But what if I told you that this single line of code is likely &lt;strong&gt;slowing down your CI/CD&lt;/strong&gt;, &lt;strong&gt;bloating your bundle size&lt;/strong&gt;, and causing those nightmare &lt;strong&gt;"Module is undefined" circular dependency errors&lt;/strong&gt;?&lt;/p&gt;

&lt;p&gt;I built a tool to fix this automatically, and today I’m sharing it with you.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Hidden Cost of Barrel Files 📉
&lt;/h2&gt;

&lt;p&gt;When you import a single named export from a barrel file, many bundlers and test runners (like Jest) end up loading &lt;strong&gt;every other file&lt;/strong&gt; exported in that barrel to resolve the module.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt; &lt;strong&gt;Slower Tests:&lt;/strong&gt; In Jest, importing &lt;code&gt;Button&lt;/code&gt; might accidentally load &lt;code&gt;Table&lt;/code&gt;, &lt;code&gt;Chart&lt;/code&gt;, and &lt;code&gt;HeavyLibrary&lt;/code&gt; just because they share an &lt;code&gt;index.ts&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Tree-Shaking Failures:&lt;/strong&gt; Webpack and Rollup are getting better, but deeply nested barrel files often trick them into including dead code in your production bundle.&lt;/li&gt;
&lt;li&gt; &lt;strong&gt;Circular Dependencies:&lt;/strong&gt; This is the big one. If Module A imports Module B via an index, and Module B imports Module A via the same index, you get a runtime crash.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  The Solution: Direct Imports 🛠️
&lt;/h2&gt;

&lt;p&gt;The fix is simple but tedious. You need to convert this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./components&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Into this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight typescript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Button&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;./components/Button&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Doing this manually for 500+ files is painful. &lt;strong&gt;So I automated it.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Introducing: &lt;code&gt;no-barrel-file&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;I created an open-source CLI tool and GitHub Action that scans your project, finds imports relying on barrel files, and &lt;strong&gt;automatically rewrites them to direct paths&lt;/strong&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  ✨ Features
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Auto-Fix:&lt;/strong&gt; Rewrites imports safely using &lt;code&gt;ts-morph&lt;/code&gt; (AST transformation, not regex).&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Smart:&lt;/strong&gt; Respects your &lt;code&gt;tsconfig.json&lt;/code&gt; paths and aliases.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Flexible:&lt;/strong&gt; Run it via &lt;code&gt;npx&lt;/code&gt;, install it globally, or run it in CI.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💻 3 Ways to Use It Locally
&lt;/h2&gt;

&lt;p&gt;Whether you want a quick check or a permanent tool for your team, there are three ways to use &lt;code&gt;no-barrel-file&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Method 1: The "One-Off" (No Install)
&lt;/h3&gt;

&lt;p&gt;The easiest way to check a project without installing dependencies is via &lt;code&gt;npx&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;# Just list the barrel files&lt;/span&gt;
npx no-barrel-file display

&lt;span class="c"&gt;# Fix the imports&lt;/span&gt;
npx no-barrel-file replace &lt;span class="nt"&gt;--alias-config-path&lt;/span&gt; tsconfig.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Method 2: The "Project Standard" (Dev Dependency)
&lt;/h3&gt;

&lt;p&gt;If you want to ensure your whole team avoids barrel files, install it as a dev dependency.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-D&lt;/span&gt; no-barrel-file
&lt;span class="c"&gt;# or&lt;/span&gt;
pnpm add &lt;span class="nt"&gt;-D&lt;/span&gt; no-barrel-file
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, add a script to your &lt;code&gt;package.json&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="nl"&gt;"scripts"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"fix:barrels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"no-barrel-file replace --alias-config-path tsconfig.json"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt;
  &lt;/span&gt;&lt;span class="nl"&gt;"check:barrels"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"no-barrel-file display"&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now anyone on the team can run &lt;code&gt;npm run fix:barrels&lt;/code&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Method 3: The "Power User" (Global Install)
&lt;/h3&gt;

&lt;p&gt;If you work across many repositories and want this tool available everywhere in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-g&lt;/span&gt; no-barrel-file

&lt;span class="c"&gt;# Now you can run it anywhere&lt;/span&gt;
no-barrel-file display
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🤖 Automate it with GitHub Actions
&lt;/h2&gt;

&lt;p&gt;The best way to maintain code quality is to automate it. I published a &lt;strong&gt;GitHub Action&lt;/strong&gt; so you can ensure no new barrel files creep into your repository.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option A: Auto-Fix Mode (Recommended)
&lt;/h3&gt;

&lt;p&gt;This workflow detects lazy imports in Pull Requests, fixes them automatically, and pushes the changes back to the branch.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;File:&lt;/strong&gt; &lt;code&gt;.github/workflows/fix-barrels.yml&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Auto-Fix Barrel Files&lt;/span&gt;
&lt;span class="na"&gt;on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="pi"&gt;[&lt;/span&gt;&lt;span class="nv"&gt;pull_request&lt;/span&gt;&lt;span class="pi"&gt;]&lt;/span&gt;

&lt;span class="na"&gt;permissions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;contents&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;write&lt;/span&gt; &lt;span class="c1"&gt;# Required to commit changes&lt;/span&gt;

&lt;span class="na"&gt;jobs&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
  &lt;span class="na"&gt;fix-imports&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;runs-on&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;ubuntu-latest&lt;/span&gt;
    &lt;span class="na"&gt;steps&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;actions/checkout@v4&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Run No Barrel File&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;chintan9/no-barrel-file@v1&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;replace'&lt;/span&gt;
          &lt;span class="na"&gt;alias-config-path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;tsconfig.json'&lt;/span&gt;
          &lt;span class="na"&gt;extensions&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;.ts,.tsx'&lt;/span&gt;

      &lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Commit changes&lt;/span&gt;
        &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;stefanzweifel/git-auto-commit-action@v5&lt;/span&gt;
        &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
          &lt;span class="na"&gt;commit_message&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="s"&gt;refactor:&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;resolve&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;barrel&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;file&lt;/span&gt;&lt;span class="nv"&gt; &lt;/span&gt;&lt;span class="s"&gt;imports"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Option B: Audit Mode
&lt;/h3&gt;

&lt;p&gt;If you prefer not to touch the code automatically but just want to see a report of barrel files in your CI logs:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;&lt;span class="pi"&gt;-&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Audit Barrel Files&lt;/span&gt;
  &lt;span class="na"&gt;uses&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s"&gt;chintan9/no-barrel-file@v1&lt;/span&gt;
  &lt;span class="na"&gt;with&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
    &lt;span class="na"&gt;mode&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;display'&lt;/span&gt;
    &lt;span class="na"&gt;root-path&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;src'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Results
&lt;/h2&gt;

&lt;p&gt;After running this on a medium-sized React project, I saw:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;strong&gt;Jest startup time:&lt;/strong&gt; Reduced by ~30%.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Circular Dependency Errors:&lt;/strong&gt; Completely vanished.&lt;/li&gt;
&lt;li&gt;  &lt;strong&gt;Bundle Size:&lt;/strong&gt; Slight reduction (depending on your existing tree-shaking setup).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it out!
&lt;/h2&gt;

&lt;p&gt;I’d love to hear your feedback. Give it a star on GitHub if it saves you some time!&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  📦 &lt;strong&gt;NPM:&lt;/strong&gt; &lt;a href="https://www.npmjs.com/package/no-barrel-file" rel="noopener noreferrer"&gt;npmjs.com/package/no-barrel-file&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;  🐙 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/chintan9/no-barrel-file" rel="noopener noreferrer"&gt;github.com/chintan9/no-barrel-file&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Happy coding! 🚀&lt;/p&gt;

</description>
      <category>typescript</category>
      <category>javascript</category>
      <category>performance</category>
      <category>githubactions</category>
    </item>
    <item>
      <title>Plyr-react V6</title>
      <dc:creator>Chintan prajapati</dc:creator>
      <pubDate>Sat, 20 Dec 2025 05:07:54 +0000</pubDate>
      <link>https://dev.to/chintan121/plyr-react-v6-3o33</link>
      <guid>https://dev.to/chintan121/plyr-react-v6-3o33</guid>
      <description>&lt;p&gt;&lt;strong&gt;&lt;code&gt;plyr-react v6&lt;/code&gt; modernizes the API, tightens TypeScript typings, and simplifies lifecycle behavior—expect a small set of breaking changes but a much clearer migration path and better DX.&lt;/strong&gt;  &lt;/p&gt;

&lt;h3&gt;
  
  
  Design goals and why they matter
&lt;/h3&gt;

&lt;p&gt;v6 was driven by three practical goals: &lt;strong&gt;clarity&lt;/strong&gt;, &lt;strong&gt;type safety&lt;/strong&gt;, and &lt;strong&gt;predictability&lt;/strong&gt;. The public surface was intentionally narrowed so consumers only rely on well-documented, stable exports. &lt;strong&gt;TypeScript-first typings&lt;/strong&gt; reduce runtime surprises and make editor tooling actually helpful. Lifecycle and concurrency fixes address real-world flakiness when players mount/unmount rapidly in React apps. These changes make the library easier to maintain and safer to use in production, especially in large codebases and CI pipelines.&lt;/p&gt;

&lt;h3&gt;
  
  
  Key design decisions (technical summary)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Named public API&lt;/strong&gt;: The component and hook are explicit exports. This reduces accidental reliance on internal utilities and enables better tree-shaking.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hook-first ergonomics&lt;/strong&gt;: &lt;code&gt;usePlyr&lt;/code&gt; is the recommended path for imperative control; the component remains for simple declarative use. The hook returns a typed &lt;code&gt;instance&lt;/code&gt; and stable attach/detach helpers.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stronger typings&lt;/strong&gt;: Events are modeled as discriminated unions and the player instance exposes typed methods (&lt;code&gt;play&lt;/code&gt;, &lt;code&gt;pause&lt;/code&gt;, &lt;code&gt;seek&lt;/code&gt;, &lt;code&gt;on&lt;/code&gt;, &lt;code&gt;off&lt;/code&gt;). This eliminates many &lt;code&gt;any&lt;/code&gt; casts and improves DX.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lifecycle hardening&lt;/strong&gt;: Initialization waits for the DOM node, defers non-critical setup, and guards against concurrent inits; cleanup is idempotent to avoid double-destroy errors.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Distribution clarity&lt;/strong&gt;: ESM and CJS entry points are preserved, and CSS is consolidated to a single canonical import path to avoid bundler surprises.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Real-world migration examples
&lt;/h3&gt;

&lt;p&gt;Below are concise, practical changes you’ll make when upgrading from v5 → v6.&lt;/p&gt;

&lt;h4&gt;
  
  
  1) Update package and imports
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;plyr-react@^6.0.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// v5&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;Plyr&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;plyr-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;plyr-react/plyr.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// v6&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Plyr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;usePlyr&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;plyr-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;plyr-react/dist/plyr.css&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; v6 uses named exports and a consolidated CSS path—update imports accordingly.&lt;/p&gt;

&lt;h4&gt;
  
  
  2) Flattened props and typed callbacks
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="c1"&gt;// v5 style&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Plyr&lt;/span&gt;
  &lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;video&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;sources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/video.mp4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;options&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;controls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;play&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;progress&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;onReady&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;player&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* untyped */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;

&lt;span class="c1"&gt;// v6 style&lt;/span&gt;
&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nc"&gt;Plyr&lt;/span&gt;
  &lt;span class="na"&gt;source&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;video&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;sources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[{&lt;/span&gt; &lt;span class="na"&gt;src&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/video.mp4&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;}]&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;controls&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;play&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;progress&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
  &lt;span class="na"&gt;onReady&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;PlyrInstance&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* typed instance */&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Some props were flattened or renamed; check the changelog for exact mappings.&lt;/p&gt;

&lt;h4&gt;
  
  
  3) Using &lt;code&gt;usePlyr&lt;/code&gt; for advanced control
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;useEffect&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;usePlyr&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;plyr-react&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;Advanced&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;useRef&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;attach&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;usePlyr&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nf"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;current&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;attach&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="nf"&gt;useEffect&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;timeupdate&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="cm"&gt;/* typed payload */&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="k"&gt;return &lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;off&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;timeupdate&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;instance&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;

  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="na"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;ref&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt; &lt;span class="p"&gt;/&amp;gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; &lt;code&gt;usePlyr&lt;/code&gt; gives explicit attach/detach control and a typed instance—prefer it for complex integrations.&lt;/p&gt;

&lt;h3&gt;
  
  
  Testing and rollout tips
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Run &lt;code&gt;tsc --noEmit&lt;/code&gt;&lt;/strong&gt; to catch typing regressions.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Smoke test&lt;/strong&gt; play/pause/seek/fullscreen in a headless browser.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Search for internal imports&lt;/strong&gt; in your codebase and replace them with public types and APIs.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;v6 trades a few breaking changes for &lt;strong&gt;long-term stability, better DX, and fewer runtime surprises&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/chintan9/plyr-react" rel="noopener noreferrer"&gt;https://github.com/chintan9/plyr-react&lt;/a&gt; &lt;/p&gt;

</description>
      <category>news</category>
      <category>typescript</category>
      <category>react</category>
      <category>javascript</category>
    </item>
    <item>
      <title>plyr-react </title>
      <dc:creator>Chintan prajapati</dc:creator>
      <pubDate>Fri, 25 Sep 2020 20:06:50 +0000</pubDate>
      <link>https://dev.to/chintan121/plyr-react-41pf</link>
      <guid>https://dev.to/chintan121/plyr-react-41pf</guid>
      <description>&lt;p&gt;Release new version of plyr-react@3 with typescript. &lt;/p&gt;

&lt;p&gt;Here you can see in action. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://stackblitz.com/edit/react-r8vmzh?embed=1&amp;amp;file=src/App.js&amp;amp;hideExplorer=1&amp;amp;hideNavigation=1&amp;amp;view=preview" rel="noopener noreferrer"&gt;https://stackblitz.com/edit/react-r8vmzh?embed=1&amp;amp;file=src/App.js&amp;amp;hideExplorer=1&amp;amp;hideNavigation=1&amp;amp;view=preview&lt;/a&gt;&lt;/p&gt;


&lt;div class="ltag-github-readme-tag"&gt;
  &lt;div class="readme-overview"&gt;
    &lt;h2&gt;
      &lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev.to%2Fassets%2Fgithub-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg" alt="GitHub logo"&gt;
      &lt;a href="https://github.com/chintan9" rel="noopener noreferrer"&gt;
        chintan9
      &lt;/a&gt; / &lt;a href="https://github.com/chintan9/plyr-react" rel="noopener noreferrer"&gt;
        plyr-react
      &lt;/a&gt;
    &lt;/h2&gt;
    &lt;h3&gt;
      A simple, accessible and customisable react media player for Video, Audio, YouTube and Vimeo
    &lt;/h3&gt;
  &lt;/div&gt;
  &lt;div class="ltag-github-body"&gt;
    
&lt;div id="readme" class="md"&gt;
&lt;div class="markdown-heading"&gt;
&lt;h1 class="heading-element"&gt;Plyr React&lt;/h1&gt;
&lt;/div&gt;
&lt;p&gt;&lt;a rel="noopener noreferrer nofollow" href="https://user-images.githubusercontent.com/23579958/143738613-d374adcf-24b8-4f44-8e75-673d5681c1a5.png"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fuser-images.githubusercontent.com%2F23579958%2F143738613-d374adcf-24b8-4f44-8e75-673d5681c1a5.png" title="plyr-react" alt="plyr-react logo" width="450"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
A responsive media player that is simple, easy to use, and customizable for video, audio, YouTube, and Vimeo
  &lt;br&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/8a08c319bec2a8058dc5c991a16f6371f47695a3882f4179e95ebcc962d612f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f547265652532305368616b6561626c652d643465313537"&gt;&lt;img src="https://camo.githubusercontent.com/8a08c319bec2a8058dc5c991a16f6371f47695a3882f4179e95ebcc962d612f7/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f547265652532305368616b6561626c652d643465313537" alt="tree-shakeable"&gt;&lt;/a&gt;
  &lt;a rel="noopener noreferrer nofollow" href="https://camo.githubusercontent.com/75a1e639bc96bd29320dbfd26f2b6785ed5dac121b906768acca19a83d8d6c76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53696465253230456666656374253230467265652d666665623362"&gt;&lt;img src="https://camo.githubusercontent.com/75a1e639bc96bd29320dbfd26f2b6785ed5dac121b906768acca19a83d8d6c76/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f53696465253230456666656374253230467265652d666665623362" alt="side-effect free"&gt;&lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;
  &lt;a href="https://github.com/chintan9/plyr-react/blob/master/LICENSE" rel="noopener noreferrer"&gt;
  &lt;img src="https://camo.githubusercontent.com/d109eaf26644e564842ea7ef821ff36b1dbacdaf7f168d1cc05a777e483d6147/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e7376673f7374796c653d666c617426636f6c6f72413d30303030303026636f6c6f72423d303030303030" alt="License"&gt;
  &lt;/a&gt;
  &lt;a href="https://www.npmjs.com/package/plyr-react" rel="nofollow noopener noreferrer"&gt;
  &lt;img src="https://camo.githubusercontent.com/06458604e85dee735fa5a7de2d8ce492e6ef2b4f7f4670b936c6fad364d0e7d6/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f706c79722d72656163743f7374796c653d666c617426636f6c6f72413d30303030303026636f6c6f72423d303030303030" alt="Version"&gt;
  &lt;/a&gt;
  &lt;a href="https://www.npmjs.com/package/plyr-react" rel="nofollow noopener noreferrer"&gt;
  &lt;img src="https://camo.githubusercontent.com/2f80e8b78220ac910d49ade459c8143b223a240c9e8142cc205bfa4200e8f260/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f64742f706c79722d72656163742e7376673f7374796c653d666c617426636f6c6f72413d30303030303026636f6c6f72423d303030303030" alt="Downloads"&gt;
  &lt;/a&gt;
&lt;/p&gt;

&lt;p&gt;You can see a live demo &lt;a href="https://githubbox.com/chintan9/plyr-react/tree/master/example/react" rel="nofollow noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Make sure to select the version for the plyr-react in the dependencies.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Installation&lt;/h2&gt;
&lt;/div&gt;

&lt;div class="highlight highlight-source-shell notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; NPM&lt;/span&gt;
npm install plyr-react

&lt;span class="pl-c"&gt;&lt;span class="pl-c"&gt;#&lt;/span&gt; Yarn&lt;/span&gt;
yarn add plyr-react&lt;/pre&gt;

&lt;/div&gt;
&lt;div class="markdown-heading"&gt;
&lt;h2 class="heading-element"&gt;Usage&lt;/h2&gt;

&lt;/div&gt;

&lt;div class="markdown-heading"&gt;
&lt;h3 class="heading-element"&gt;Ready to use &lt;code&gt;&amp;lt;Plyr /&amp;gt;&lt;/code&gt; component&lt;/h3&gt;

&lt;/div&gt;

&lt;p&gt;The simplest form of react integration with the plyr is to use the &lt;code&gt;&amp;lt;Plyr /&amp;gt;&lt;/code&gt; component, it is best for the static
videos.&lt;/p&gt;
&lt;div class="highlight highlight-source-tsx notranslate position-relative overflow-auto js-code-highlight"&gt;
&lt;pre&gt;&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-smi"&gt;Plyr&lt;/span&gt; &lt;span class="pl-k"&gt;from&lt;/span&gt; &lt;span class="pl-s"&gt;"plyr-react"&lt;/span&gt;
&lt;span class="pl-k"&gt;import&lt;/span&gt; &lt;span class="pl-s"&gt;"plyr-react/plyr.css"&lt;/span&gt;

&lt;span class="pl-k"&gt;const&lt;/span&gt; &lt;span class="pl-s1"&gt;plyrProps&lt;/span&gt; &lt;span class="pl-c1"&gt;=&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
  &lt;span class="pl-c1"&gt;source&lt;/span&gt;: &lt;span class="pl-c1"&gt;undefined&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-c"&gt;// https://github.com/sampotts/plyr#the-source-setter&lt;/span&gt;
  &lt;span class="pl-c1"&gt;options&lt;/span&gt;: &lt;span class="pl-c1"&gt;undefined&lt;/span&gt;&lt;span class="pl-kos"&gt;,&lt;/span&gt; &lt;span class="pl-c"&gt;// https://github.com/sampotts/plyr#options&lt;/span&gt;
  &lt;span class="pl-c"&gt;// Direct props for inner video tag (mdn.io/video)&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;

&lt;span class="pl-k"&gt;function&lt;/span&gt; &lt;span class="pl-smi"&gt;MyPlyrVideo&lt;/span&gt;&lt;span class="pl-kos"&gt;(&lt;/span&gt;&lt;span class="pl-kos"&gt;)&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;
  &lt;span class="pl-k"&gt;return&lt;/span&gt; &lt;span class="pl-c1"&gt;&amp;lt;&lt;/span&gt;&lt;span class="pl-smi"&gt;Plyr&lt;/span&gt; &lt;span class="pl-kos"&gt;{&lt;/span&gt;...&lt;span class="pl-s1"&gt;plyrProps&lt;/span&gt;&lt;span class="pl-kos"&gt;}&lt;/span&gt; &lt;span class="pl-c1"&gt;/&lt;/span&gt;&lt;span class="pl-c1"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="pl-kos"&gt;}&lt;/span&gt;&lt;/pre&gt;

&lt;/div&gt;

Old version 4 plyr-react
- The path for an import of css styles has been changed in version 5, if you are using…&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="gh-btn-container"&gt;&lt;a class="gh-btn" href="https://github.com/chintan9/plyr-react" rel="noopener noreferrer"&gt;View on GitHub&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;


</description>
      <category>showdev</category>
      <category>react</category>
      <category>typescript</category>
    </item>
    <item>
      <title>Selection Recovery Site of Location in Business Continuity</title>
      <dc:creator>Chintan prajapati</dc:creator>
      <pubDate>Tue, 19 May 2020 18:31:09 +0000</pubDate>
      <link>https://dev.to/chintan121/selection-recovery-site-of-location-in-business-continuity-37j7</link>
      <guid>https://dev.to/chintan121/selection-recovery-site-of-location-in-business-continuity-37j7</guid>
      <description>&lt;h3&gt;
  
  
  Selection Recovery Site of Location in Business Continuity
&lt;/h3&gt;

&lt;p&gt;While there are a number of important considerations to take into account when planning your business continuity efforts, the one we hear about time and again is how much distance is really necessary between the main work site and a disaster recovery site.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;Serious business interruptions are now measured in minutes rather than hours.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Because electronic transactions and communications take place so quickly, the amount of work and business lost in an hour far exceeds the toll of previous decades. In the words of the Disaster Recovery, there is no rule of thumb when it comes to the appropriate distance between your data center and your recovery site.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Between 2007 and 2010, however, the average distance between a primary data center and its furthest backup data center seemed to shrink the majority of surveyed companies that had disaster recovery sites appeared comfortable with distances of less than 100 miles, and many were comfortable with distances of less than 25 miles.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Nonetheless, the components of integrated business continuity are the same: recovery options for facilities, technology, network infrastructure and human skills. However, the key to business continuity lies in understanding one’s business and determining which processes are critical to staying in that business and identifying all the elements crucial to those processes — specialized skills and knowledge, physical facilities, training and employee satisfaction as well as information technology.&lt;/p&gt;

&lt;p&gt;If you are thinking about a secondary disaster recovery site for your business data, take the following questions into consideration:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is there enough distance between your main site and your disaster recovery site to escape the same set of threats?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your business is in the line of fire of hurricanes, &lt;em&gt;for example,&lt;/em&gt; then you will want to look for a recovery site that is more than 100 miles away from your main site this should prevent a hurricane event from taking out both your main site and your recovery site. So, the decision is obviously left to the companies themselves — and such decisions cannot be made based on someone’s feeling, but on a study.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;A Risk Assessment that involves identifying a potential risk event, assessing the likelihood of the event occurring, and defining the severity of the event’s consequences.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Risks could be anything from a power outage or hardware failure to a tornado or flood. Here are the factors that tend to push the location further away:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Earthquakes&lt;/em&gt; — if your location is in a seismic-sensitive area&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Floods&lt;/em&gt; — you should position an alternative site out of the same flood plain&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Tsunamis&lt;/em&gt; — you shouldn’t place both primary and secondary location on the coast of an ocean&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Other natural disasters —&lt;/em&gt; e.g. forest fires, tornados/hurricanes,volcanos — if your primary site is close to such areas,&lt;/p&gt;

&lt;p&gt;the disaster recovery site should be further away Large industrial facilities, nuclear power plants, or military installations — again,&lt;/p&gt;

&lt;p&gt;at least one of your locations should be at a safe distance Dependence on the same source of electrical power.&lt;/p&gt;

&lt;p&gt;you should look for locations on a different power grid pandemic diseases — in such cases, authorities will likely close the whole metropolitan area.&lt;/p&gt;

&lt;p&gt;However, there are some factors that force you to position a disaster recovery location as close as possible:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Telecommunication links&lt;/em&gt; — the further the sites are away, the more difficult it becomes (i.e. more costly) to replicate the data between these sites.&lt;/p&gt;

&lt;p&gt;If your employees are expected to travel to an alternative site in case of disaster — they have to be able to make it within the &lt;strong&gt;RTO&lt;/strong&gt; (Recovery Time Objective); besides, the road between the sites shouldn’t be full of bridges and tunnels.&lt;/p&gt;

&lt;p&gt;The goal for companies with no business tolerance for downtime is to achieve a state of business continuity, where critical systems and networks are available no matter what happens. This means thinking proactively; engineering availability, security and reliability into business processes from the outset — not retrofitting a disaster recovery plan to accommodate ongoing business requirements.&lt;/p&gt;

&lt;p&gt;For all the sophisticated technologies available today, according to analyst reports,approximately 75 percent of the world’s data is still protected from copying it to magnetic tape and shipping it off to some secure off-site storage. At its most basic level, choosing the right disaster recovery technology is a business decision. As a result, before IT departments can decide on a disaster recovery technology, they have to establish the business priorities and objectives that the technology will be required to meet.&lt;/p&gt;

&lt;p&gt;This step can be one of the most challenging for IT because it involves reaching across the aisle to the business side.“Immediately” and “none” are the two most common answers from department heads when asked how fast data needs to be recovered (RTO) and how much data they can afford to lose(RPO).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;At its most basic level, choosing the right disaster recovery technology is a business decision.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Establishing appropriate, realistic and affordable RTO and RPO levels needs to be negotiated between the IT department and business leaders. It’s often a balancing act. Having an outside,unbiased business continuity planner present during these discussions helps them proceed to mutually acceptable conclusion.&lt;/p&gt;

&lt;p&gt;When recovering data or systems across a significant distance, slower recovery times and bandwidth costs can negatively impact business continuity goals.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;When answering the question of how far away a DR site should be from the primary site, then, it’s a matter of mitigating shared risks, not measuring miles.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;By &lt;a href="https://medium.com/@chintan121"&gt;Chintan prajapati&lt;/a&gt; on &lt;a href="https://medium.com/p/9914d9e43684"&gt;September 26, 2015&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@chintan121/selection-recovery-site-of-location-in-business-continuity-9914d9e43684"&gt;Canonical link&lt;/a&gt;&lt;/p&gt;

</description>
      <category>architecture</category>
      <category>distributedsystems</category>
    </item>
  </channel>
</rss>
