Re:Making a Statically-Linked, Single-File Web App with Reac...
by Justsignedup on Thursday April 05, 2018 @10:16AM
(#16765076)
I do similar, except I just deploy to AWS as a static website. Super duper minimal everything.
[ Parent
| on HN ]
Re:Making a Statically-Linked, Single-File Web App with Reac...
by nothrabannosir on Thursday April 05, 2018 @10:35AM
(#16765250)
If you only have static files, might as well go with Netlify. Can’t beat them for simplicity.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by kowdermeister on Thursday April 05, 2018 @10:30AM
(#16765203)
The tutorial stops where it starts to get interesting, actually implementing any logic with the backend other than serving static files. It would have been interesting to follow through a database transaction or see some data / image manipulation.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by anderspitman on Thursday April 05, 2018 @10:38AM
(#16765290)
I actually agree. I extracted this tutorial from a project I'm working on developing an RTS game for school. I'm experimenting with having the game loop run in Rust and seeing if I can send render updates fast enough to smoothly run the UI in JS. It's working pretty well so far. I'm using Protobuf 3. I'd love to get capnproto or flatbuffers working eventually, but neither of them seem to have both JS and Rust support mature yet. I think the next obvious evolution from this tutorial would be to connect a sqlite db. Not sure how easy statically linking with it is though.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by NiceGuy_Ty on Thursday April 05, 2018 @11:18AM
(#16765678)
Are you talking about statically linking the database itself? Seems like it'd be better to keep the database separate from the binary, unless you're working with a read-only database.
For static-linking the sqlite3 library, if you're using rusqlite you can just specify the bundled feature in Cargo.toml.
``` [dependencies.rusqlite] version = "your-version-number" features = ["bundled"] ```
Re:Making a Statically-Linked, Single-File Web App with Reac...
by anderspitman on Thursday April 05, 2018 @11:47PM
(#16770738)
Yeah I meant statically linking the sqlite library. Thanks for the tip on how to do it
Re:Making a Statically-Linked, Single-File Web App with Reac...
by shae on Thursday April 05, 2018 @10:35AM
(#16765247)
I have such a thing in Haskell: https://github.com/shapr/sporkle/blob/master/app/Main.hs
It's not Rust, but it is a really crappy exercise tracking app I wrote for teaching a class.
Thing different about my code: I build the HTML in the source itself, and I don't use React
Re:Making a Statically-Linked, Single-File Web App with Reac...
by CapacitorSet on Thursday April 05, 2018 @10:25AM
(#16765158)
If you want to go super-minimal at the cost of being more dependent on Amazon, you can deploy the static website on S3 and use Route53 as an HTTP frontend.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by kowdermeister on Thursday April 05, 2018 @10:29AM
(#16765182)
Last week I learned that if you configure your bucket name the same as your domain, then a simple CNAME record will work without Route53.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by urschrei on Thursday April 05, 2018 @10:38AM
(#16765284)
I don't think you can make SSL work on AWS without Route53, though. Which is (for better or worse) about to become a big problem when Google starts penalising non-SSL sites.
You also can't make a AAAA record, so no IPv6.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by seeekr on Thursday April 05, 2018 @10:51AM
(#16765412)
Put Cloudflare in front for SSL. Not sure if that makes the solution more or less complex, never worked with Route53.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by estsauver on Thursday April 05, 2018 @11:00AM
(#16765504)
As of two years ago, there was a bug with mobile safari and hash fragment preservation, which actually made using a lot of client side JS code very difficult to use directly from s3.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by cloverich on Thursday April 05, 2018 @11:03AM
(#16765534)
This is what I do on Google cloud, presumably the same. CloudFlare for ssl, google Cloud DNS, then a Google bucket. Real simple, real fast.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by ztoben on Thursday April 05, 2018 @11:22AM
(#16765708)
Yep, this is what I do for my site. 51 cents a month.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by ggregoire on Thursday April 05, 2018 @10:27AM
(#16765175)
Yes. Here is a guide to deploy a React app on S3 and CloudFront (with a backend on EC2): https://stackoverflow.com/questions/41250087/how-to-deploy-a...
Re:Making a Statically-Linked, Single-File Web App with Reac...
by INTPenis on Thursday April 05, 2018 @10:18AM
(#16765088)
Inline JS and css? My first thought was that I'd rather leave the Rust part out and do what you suggest in order to deploy to static file cloud hosts.
Re:Making a Statically-Linked, Single-File Web App with Reac...
by DaveTheSane on Thursday April 05, 2018 @10:27AM
(#16765174)
And you can scale this so good, we do something like this with every branch/user story to test it on live environments. Supereasy, once set up.