r/javascript • • Jul 28 '19

ScriptUI: Write React without JSX

https://github.com/anater/ScriptUI
1 Upvotes

22 comments sorted by

View all comments

Show parent comments

0

u/[deleted] Jul 29 '19

You’re right that, as of today, all that is necessary. My opinion is it shouldn’t be necessary.

I think the status quo is a burden and wastes mental cycles better spent creating something. <script> should be all that’s needed to get up and running.

And so I figure I try to see what it might look like if you start without it and this is where I ended up. You don’t have to use it or like it. It’s an experiment.

1

u/Delioth Jul 29 '19

The biggest reason that more than a <script> is necessary... is that you first need to set something up to serve that <script>. You have to start up a server at some point, and a webpack-dev-server configured by CRA running with Node is one of the most painless servers to get going... ever. And it happens to also give you all the tools real work is going to use (or at least approximations of them).

0

u/[deleted] Jul 29 '19

You literally don’t need a server to use a <script> tag. You just need a raw JS file and a raw HTML file. Then open the HTML in a browser and: there’s your webpage! No server required.

Netflix, Amazon S3, or Github Pages offer (cheap or free) static file hosting that removes the need to think about a server.

Seriously, not every project needs all the tools you’re defending to get started, maintain, or host online. My argument is it’s possible to improve the dev experience without them. I find they are harmful to new devs and slightly annoying for more experienced devs: especially when they break.

1

u/Delioth Jul 29 '19

Well, those are servers, so...

And it's not like I'm advocating for a ton of tools. Just Node (which is useful for many things), Babel (which every site should use anyways so that people with browsers you didn't bother to check can still use your site), and webpack (which is immensely useful to know, and almost trivial to set up for simple projects anymore).

I think it's harmful to try and expose React with a weird API for the sole purpose of eliminating the need for supporting software. There's a reason we have the supporting software in most all projects, and why it's trivial to setup anymore.