tsdx icon indicating copy to clipboard operation
tsdx copied to clipboard

Add example playground for non-react projects

Open luisrudge opened this issue 6 years ago • 4 comments

Current Behavior

When creating a non-react project, all you get is watching a build from a file, but you can't actually do anything with it. If you're developing a browser library, for example, you can't target this watched file from an html file.

Desired Behavior

I think it makes sense to create an example project that consumes the library (maybe differentiate between a node and a browser lib?) so we can test the library in the browser. My library, for example, opens popups, does redirects etc, so I need to test in a real browser.

Suggested Solution

Create the example project with parcel/etc for non-react projects.

Who does this impact? Who is this for?

Devs creating browser libraries

Describe alternatives you've considered

None, really. What I'm doing right now is building the project every time and using the generated files from a static html file. Sucks because there's no watching / auto reloading.

luisrudge avatar Aug 15 '19 13:08 luisrudge

no objections altho jared may not want to take on maintenance burden. may be better to develop this as a wholly separate example project and we can link to it

swyxio avatar Aug 15 '19 13:08 swyxio

I think exposing the watched file in an endpoint would be a good first start. It doesn't add the burden of maintaining a whole example folder and also enables me to reference the script from somewhere else. Althought not ideal, at least it would allow me to actually develop the library in development mode.

luisrudge avatar Aug 15 '19 14:08 luisrudge

Can we just document how to use like serve On the dist directory?

jaredpalmer avatar Aug 27 '19 14:08 jaredpalmer

Can we just document how to use like serve On the dist directory?

Yes please. Trying to develop a vanilla js UDM browser plugin as well without it!

MentalGear avatar Jul 13 '21 12:07 MentalGear