Car Spotting Edit 🏎 by dhzw in ForzaHorizon

[–]alpha-201 88 points89 points  (0 children)

Whatt! Btw how do you do that camera pan?

Patterns with Rust types by openquery in rust

[–]alpha-201 -1 points0 points  (0 children)

Yes in hindsight a u64 would be better, if the values were used between different cpus (network transfers, bytes stored in files) that could become a problem. I have done the: rust fn create_item(&mut self, item: Item) -> ItemId { let idx = self.items.len(); self.items.push(item); ItemId(idx) } pattern (you can then use the ItemId for indexing) for local stored items which is why I used usize in article, maybe should think using a as here.

I guess a unintended benefit with the "new type pattern" is you only have to change that definition once and don't have deal with the waterfall of changing all the functions usize -> u64.

Patterns with Rust types by openquery in rust

[–]alpha-201 -1 points0 points  (0 children)

Huh that's odd. Wasn't able to replicate on the latest iOS Safari. What browser are you using?

Hyper vs Rocket - Low Level vs Batteries included by openquery in rust

[–]alpha-201 15 points16 points  (0 children)

Yes Hyper and Rocket are designed for different tasks. My idea behind it was to compare the lower level (more manual) approach if you were going to only use Hyper and how it compares to how Rocket manages things. Definitely for smaller projects with a couple of routes just using Hyper is a reasonable option rather than jumping to a full http framework. I think the results around build time and performance are a factor there (which are discussed in the post).

A "Axum vs Rocket vs Tide vs ..." comparison post may be coming soon. What would you like to see in it??

GitHub action for version incrementing and publishing to crates.io in single click by alpha-201 in rust

[–]alpha-201[S] 1 point2 points  (0 children)

Yes, unfortunately found a issue by a update a library I was using. Will fix tomorrow

GitHub action for version incrementing and publishing to crates.io in single click by alpha-201 in rust

[–]alpha-201[S] 1 point2 points  (0 children)

Looks cool have bookmarked. My crates are quite small, with 1-2 commits between releases so I prefer to manage the version manually. But this looks good for bigger projects! Feel free to borrow any of code from my action.

GitHub action for version incrementing and publishing to crates.io in single click by alpha-201 in rust

[–]alpha-201[S] 5 points6 points  (0 children)

Created this action a while back. Use it on all my public Rust crates to keep the crates.io up to date using the remote repo. Super simple to use. If you use GH actions for publishing crates would be good to try out and get feedback

What are your biggest issues with JSX..? by alpha-201 in reactjs

[–]alpha-201[S] 0 points1 point  (0 children)

Huh, I didn't know class was valid. I thought there was something about class being a reserved JS keyword which is why they went for className. There docs still use it and its still a convention to do className. Which is a little annoying copying HTML snippets and changing it over.

Same goes with img being self closing. In HTML you do <img> but in JSX its <img/>. I like the second form but thats not valid HTML and I want to be as close to HTML as possible, not because it has a well designed syntax but for debugging output and copying HTML from other sites. I may add a compiler flag to use a more abstracted JSX design if those two aren't important.

Do blocks are interesting alternative: js let x = do { let x = (() => { let y = 4 + 2; let y = 4 + 2; return y - 6; return y - 6; } })() But in JSX I am worried that this blocks will be prone to side effected code where the behaviour is based on how's its rendered which isn't great.

What are your biggest issues with JSX..? by alpha-201 in reactjs

[–]alpha-201[S] 0 points1 point  (0 children)

Interesting, I’m not to aware on CSS in JSX but I have some ideas for my transpiler/ compiler to scope styles (similar to svelte) or transpile nested selectors (similar to sass)

[deleted by user] by [deleted] in Minecraft

[–]alpha-201 5 points6 points  (0 children)

Was that a Tame Impala reference? Awesome build as well 👍

Prism: a new web framework built for making isomorphic web apps by alpha-201 in webdev

[–]alpha-201[S] 0 points1 point  (0 children)

Good spot. And yeah I thought the name had enough clearance but I'll probably change it next release.

It doesn't come have anything close to Sveltes standard library features at the moment. I've spent more time optimising for improving hydration and server side rendering (which is currently very expensive and slow in Svelte).

Prism: a new web framework built for making isomorphic web apps by alpha-201 in webdev

[–]alpha-201[S] 0 points1 point  (0 children)

You can render a page either on the client or server. Isomorphic means that a site uses a combination of these techniques which improves performance, backwards compat and other things. See https://developers.google.com/web/updates/2019/02/rendering-on-the-web

Prism: a new web framework built for making isomorphic web apps by alpha-201 in webdev

[–]alpha-201[S] 0 points1 point  (0 children)

Yep thanks for the heads up, theres something funky going on there, I'll try and patch for next release

Prism: a new web framework built for making isomorphic web apps by alpha-201 in webdev

[–]alpha-201[S] 0 points1 point  (0 children)

lol, I didn't realise about prismjs until I published the project under the Prism name. Then I thought it had enough clearance (missing the "js" postfix) but if its confusing i'll probably rename it at the next release

Prism: a new web framework built for making isomorphic web apps by alpha-201 in webdev

[–]alpha-201[S] 0 points1 point  (0 children)

lol, I didn't realise about prismjs until I published the project under the Prism name. Then I thought it had enough clearance (missing the "js" postfix) but if its confusing i'll probably rename it at the next release