Hacker News new | past | comments | ask | show | jobs | submit | joelg236's comments login

You can use PM2 with Deno


Somehow I feel like if you need to install Node to run Deno, you may as well just run Node from the beginning.


This isn't valid syntax, no


This is a regression. This was possible with "require" and destructuring assignment.


I don't know why you are getting downvoted. I agree. The difference is that ES6 imports are meant to be more optimized and also can allow for async/top-level async modules. I believe part of the additions of ES6 modules made it harder to treat the right hand side like a complete object that can be destructured. In summary, it's not the syntax, it's the difference in feature richness between ES6 and CommonJS importing.


Yeah, I'm not saying that import was a mistake or even a good idea done in the wrong way. I use "import" whenever I can in my own code. It could be impossible to import only the particular things one needs, and that trusting tree-shaking is the best we can do. However, it very much seems like a first version to me, and that import statements could be made smart enough to destructure.


Yeah, was afraid it might be bad ES6. But this is Delo, so they can do whatever they want.


No they can't, Deno is JavaScript compliant


For non-code assets, do you know about `include_bytes`?


I found rust-embed recently[0], which lets you embed an entire directory in release mode while deferring to the file system in debug mode.

[0]: https://github.com/pyros2097/rust-embed


Servall | Calgary, Canada | Web Developer | Onsite | Full-time

We are a custom software development company that has built a brand around our core product, PatronScan - the most widely used ID scanning software in Canada, USA, UK and Australia. We have been growing very quickly over the last few years, and are looking for talented developers to help us keep pushing forwards.

We're looking for frontend developers who are self-driven, creative, and forward thinking.

Stack: React / React Native / Electron / TypeScript / Docker / Gitlab / Koa / Rust / ...

Get in contact with us through hr@servalldev.com


Servall | Calgary, Canada | Web Developer | Onsite | Full-time

We are a custom software development company that has built a brand around our core product, PatronScan - the most widely used ID scanning software in Canada, USA, UK and Australia. We have been growing very quickly over the last few years, and are looking for talented developers to help us keep pushing forwards.

We're looking for frontend developers who are self-driven, creative, and forward thinking.

Stack: React / React Native / Electron / TypeScript / Docker / Gitlab / Koa / Rust / ...

Get in contact with us through hr@servalldev.com


In the keynote, Dan talked about how this works. It depends on the order that useState is called, which makes conditional branches a no-no (there's a linter for it).


Since JS is single threaded, they are basically keeping track of which component was last called for render - that way they know useState() calls attached to which components. If the order changes, then they can't keep track of the different objects tracked by useState. So treat it like you would class state - all fields are always there, no matter which functions or conditional branches you take - hence - do your initialization above all your conditionals and loops.

Edit: And yes, slight concern of course, it's the got some rough semantic equivalents to a thread-local in Java, albeit in Java the danger exists downstream, this danger is only exhibited during initialization it seems.


IIUC, the order isn't used to figure out which React component is being rendered, but which of potentially several hook invocations within that single component is currently being invoked. If every unique hook could only be (directly or indirectly) called a single time per component, then there wouldn't need to be this ordering restriction. (Or more realistically, if each hook call also took an ID that is unique per-component.)


Just looking at the code I came to the conclusion it had to work that way, I don't like it, way too easy to break and some people are going to be very confused when things goes wrong. It's a uncommon/unfamiliar coding constraint. If you have to declare them all in the same order every time, you might as well force a single state (like the setState API) and/or keyed state values and have a safe API.


Servall | Calgary, Canada | Web Developer | Onsite | Full-time

We are a custom software development company that has built a brand around our core product, PatronScan - the most widely used ID scanning software in Canada, USA, UK and Australia. We have been growing very quickly over the last few years, and are looking for talented developers to help us keep pushing forwards.

We're looking for frontend developers who are self-driven, creative, and forward thinking.

Stack: React / React Native / Electron / TypeScript / Docker / Gitlab / Koa / ...

Get in contact with us through hr@servalldev.com


Servall | Calgary, Canada | Web Developer | Onsite | Full-time

We are a custom software development company that has built a brand around our core product, PatronScan - the most widely used ID scanning software in Canada, USA, UK and Australia. We have been growing very quickly over the last few years, and are looking for talented developers to help us keep pushing forwards.

We're looking for frontend developers who are self-driven, creative, and forward thinking.

Stack: React / React Native / Electron / TypeScript / Docker / Gitlab / Koa / ...

Get in contact with us through hr@servalldev.com


Servall | Calgary, Canada | Web Developer | Onsite | Full-time

We are a custom software development company that has built a brand around our core product, PatronScan - the most widely used ID scanning software in Canada, USA, UK and Australia. We have been growing very quickly over the last few years, and are looking for talented developers to help us keep pushing forwards.

We're looking for frontend developers who are self-driven, creative, and forward thinking.

Stack: React / React Native / Electron / TypeScript / Docker / Gitlab / Koa / ...

Get in contact with us through hr@servalldev.com



Oh sweet, looks like GitLab does. Time to migrate.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: