{"version":3,"sources":["webpack://typescriptlang-org/./src/components/devNav.tsx","webpack://typescriptlang-org/./src/pages/dev/playground-plugins.tsx","webpack://typescriptlang-org/./src/assets/playground-plugin-preview.png"],"names":["DevNav","props","isActive","str","active","toLowerCase","className","style","display","href","withPrefix","Index","title","description","lang","id","marginTop","borderLeft","src","require","width","alt","locale"],"mappings":"qLAOaA,EAAS,SAACC,GACrB,IAAMC,EAAW,SAACC,GAAD,OACfF,EAAMG,QAAUH,EAAMG,OAAOC,gBAAkBF,EAAM,SAAW,IAElE,OAAO,uBAAKG,UAAU,wBACpB,sBAAIA,UAAU,OACZ,sBAAIA,UAAU,QAAO,8CACrB,sBAAIC,MAAO,CAAEC,QAAS,SACpB,qBAAGF,UAAWJ,EAAS,gBAAiBO,MAAMC,gBAAW,kBAAzD,iBAEF,0BACE,qBAAGJ,UAAWJ,EAAS,WAAYO,MAAMC,gBAAW,iBAApD,YAEF,0BACE,qBAAGJ,UAAWJ,EAAS,YAAaO,MAAMC,gBAAW,kBAArD,aAEF,0BACE,qBAAGJ,UAAWJ,EAAS,kBAAmBO,MAAMC,gBAAW,wBAA3D,mBAEF,0BACE,qBAAGJ,UAAWJ,EAAS,sBAAuBO,MAAMC,gBAAW,4BAA/D,uBAEF,0BACE,qBAAGJ,UAAWJ,EAAS,iBAAkBO,MAAMC,gBAAW,uBAA1D,sB,+FCpBFC,EAAyB,SAACV,GAC9B,OACE,gCACE,gBAAC,IAAD,CAAQW,MAAM,kCAAkCC,YAAY,oEAAoEC,KAAK,MACnI,uBAAKC,GAAG,OACN,gBAAC,IAAD,CAAQX,OAAO,uBACf,uBAAKE,UAAU,qCACb,uBAAKA,UAAU,qBACb,sBAAIC,MAAO,CAAES,UAAW,SAAxB,0BACA,qKACA,yMACA,kLACA,8BACA,kQACA,iEAAwC,qBAAGP,KAAK,+DAAR,2CAAxC,oEAA0N,qBAAGA,KAAK,6CAAR,qBAA1N,KAAqS,qBAAGA,KAAK,sEAAR,UAArS,IAA6X,qBAAGA,KAAK,qDAAR,WAA7X,KAAsc,qBAAGA,KAAK,oFAAR,eAAtc,QAAqjB,qBAAGA,KAAK,2DAAR,eAArjB,0EACA,gGAAuE,qBAAGA,KAAK,iCAAR,gCAAvE,0GAGF,uBAAKH,UAAU,cAAcC,MAAO,CAAEU,WAAY,mBAChD,uBAAKC,IAAKC,UAA+DC,MAAM,OAAOC,IAAI,2DAI9F,uBAAKf,UAAU,6BACb,4CACA,gGACA,yBAAG,mCAAH,oCAAiD,8FACjD,yBAAG,mCAAH,SAAsB,0CAAtB,sDACA,yBAAG,mCAAH,cAA2B,qBAAGG,MAAMC,gBAAW,WAApB,cAA3B,gDAAqH,qEACrH,yBAAG,mCAAH,qEACA,8BACA,2SAAkR,qBAAGD,KAAK,iIAAR,oBAElR,0CACA,iJACA,0BACE,0BAAI,qBAAGA,KAAK,oGAAR,+CACJ,0BAAI,qBAAGA,KAAK,sGAAR,iDAEN,gGAQZ,mBAAgBR,GAAD,OAAkB,gBAAC,IAAD,CAAMqB,OAAO,MAAK,gBAACX,EAAUV,M,kCCzD9D,IAAe,IAA0B","file":"component---src-pages-dev-playground-plugins-tsx-e313f2d2c7527ef21442.js","sourcesContent":["import * as React from \"react\"\nimport { withPrefix } from \"gatsby\"\n\ninterface DevNavProps {\n active?: string\n}\n\nexport const DevNav = (props: DevNavProps) => {\n const isActive = (str) =>\n props.active && props.active.toLowerCase() === str ? \"active\" : \"\"\n\n return \n}\n","import * as React from \"react\"\nimport { Layout } from \"../../components/layout\"\nimport { withPrefix, graphql } from \"gatsby\"\n\nimport \"./dev.scss\"\nimport { Intl } from \"../../components/Intl\"\nimport { DevNav } from \"../../components/devNav\"\n\ntype Props = {}\n\nconst Index: React.FC = (props) => {\n return (\n <>\n \n
\n \n
\n
\n

Your toys, our sandbox

\n

The new TypeScript Playground allows people to hook into the Playground and extend it in ways in which the TypeScript team don't expect.

\n

The sidebar of the Playground uses the same plugin infrastructure as external plugins, so you have the same level of access as the playground to build interesting projects.

\n

Playground plugins are built via the DOM API and an expansive Design System, however, you're free to use a framework like React or Svelte at runtime.

\n

 

\n

Getting started is easy, we have a plugin template, and the Playground has a dev-mode for hooking directly to your local server, so you don't need to run a copy of the TypeScript website to have a working development environment.

\n

There is a repo of sample plugins at microsoft/TypeScript-Playground-Samples and there are many existing open source plugins to look at too: Presentation Mode, Clippy TSQuery, Collaborate and Transformer which are available by default for you to investigate and understand.

\n

If you have questions as you are working on your plugin, ask in the TypeScript Community Discord. When it is polished, ship it to the npm registry and it will make its way into the plugins sidebar.

\n
\n\n
\n \"Screenshot\n
\n
\n\n
\n

Quick Tutorial

\n

You need about 5 minutes, Node.js, yarn and Firefox/Edge or Chrome.

\n

Step 1: Use the template to bootstrap: yarn create typescript-playground-plugin playground-my-plugin

\n

Step 2: Run yarn start in the new repo, to start up the local dev server

\n

Step 3: Open the playground in your browser, click \"Options\" and enable \"Connect to localhost:5000/index.js\"

\n

Step 4: Refresh, and see the new tab. That's your plugin up and running

\n

 

\n

That's all the pieces working in tandem, now you can make changes to the template and build out your plugin. The plugin in dev mode will always become forefront when connected, so you can re-load without a lot of clicks. To understand the template's technology, read the CONTRIBUTING.md

\n\n

Alternatives

\n

There are community-run templates for Playground plugins which bootstrap your plugin with well-known view libraries:

\n \n

They have their own up-to-date documentation in their READMEs.

\n
\n
\n
\n \n )\n}\n\nexport default (props: Props) => \n","export default __webpack_public_path__ + \"static/playground-plugin-preview-3fa319f7efff676f839a57ad3d8be916.png\";"],"sourceRoot":""}