Live data from Hacker News

Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

deno.com

31–40 of 57 posts

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#31
post #29

I seriously cannot wrap around my head how in 2022 people really like JSX and all that X-in-JS crap, it's like people doesn't know about separation of concerns or clean code at all.

Seperation of languages != seperation of concerns One could argue the adoption of JSX actually allows for better seperation and cleaner code as you can group all the necessary pieces of your component together, and use components declaratively without introducing some DSL seen in some frameworks like Vue, Angular etc.

Isn't className custom DSL in React?

Vue's concepts in the v-* are more pleasant than the React way, imho. Learning a bit of DAL is not a blocker for me, given how many tools already require this

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#32

Earlier quoted context omitted.

Separating which concerns?

I guess software is like your cutlery drawer. You want to keep your knives, forks and spoons separate.

True. I like keeping my knives, forks, and spoons separate.

Alternatively, try organising your cutlery by "implement" and "handle". Surely, separating what goes in your mouth from what your grubby hands touch is the right thing to do. The two concerns that should be kept separate!

To push this analogy over the edge, the former is how I see JSX. And my admittedly facetious proposal is how I view the "classical" approach of strict HTML|CSS|JS separation.

Which poses the question: after seven+ years of JSX and it having become the most prominent approach to building UIs, can the "classical"way even be called that anymore?

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#33

Hey folks, author of Fresh here. Very excited for this rather significant release. Happy to answer any questions you may have :)

I really want to try fresh together with edgedb. Any chance a builtin authentication will be added soon? Or is there a recipe to implement something like auth0?

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#34

I seriously cannot wrap around my head how in 2022 people really like JSX and all that X-in-JS crap, it's like people doesn't know about separation of concerns or clean code at all.

There's hope: https://github.com/cheatcode/joystick.

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#35
post #29

Earlier quoted context omitted.

Seperation of languages != seperation of concerns One could argue the adoption of JSX actually allows for better seperation and cleaner code as you can group all the necessary pieces of your component together, and use components declaratively without introducing some DSL seen in some frameworks like Vue, Angular etc.

Isn't className custom DSL in React? Vue's concepts in the v-* are more pleasant than the React way, imho. Learning a bit of DAL is not a blocker for me, given how many tools already require this

I'd rather just use JS syntax than learn a random v-* syntax.

You can just use the std lib to loop, filter, reduce, conditionally render, etc. rather than looking up how to loop in this specific framework with v-if, v-for, etc.

Angular 1 did that and it was limiting. Two-way data binding also failed.

Templates are dead, long live JSX.

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#36
post #29

Earlier quoted context omitted.

Seperation of languages != seperation of concerns One could argue the adoption of JSX actually allows for better seperation and cleaner code as you can group all the necessary pieces of your component together, and use components declaratively without introducing some DSL seen in some frameworks like Vue, Angular etc.

Isn't className custom DSL in React? Vue's concepts in the v-* are more pleasant than the React way, imho. Learning a bit of DAL is not a blocker for me, given how many tools already require this

No, `className` is the DOM property exposed to JavaScript that corresponds to the `class` attribute in HTML: https://developer.mozilla.org/en-US/docs/Web/API/Element/cla...

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#37
Fresh looks seriously cool! I'm especially fond of the plugins concept for bringing in compiled assets like Markdown and SCSS. And Getting started with a `deno run` command is very exciting for new-comers too!

Shameless-self promotion: I've been working on a similar web framework built on Deno and Cloudflare Workers. It's called Keywork[1] and it's made for folks who would like to create web apps for the V8 runtime, without getting too attached to a single cloud provider.

Keywork has powered all my projects as of recently, but Fresh looks like a serious contender. I would love to chat with the Deno team if they're floating around this HN thread! You're creating amazing stuff!

- [1] https://keywork.app

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#38

I just ran this and got a bad cert error. How should I fix it? deno run -A -r https://fresh.deno.dev my-project Sending fatal alert BadCertificate error: error sending request for url ( https://fresh.deno.dev/ ): error trying to connect: invalid peer certificate contents: invalid peer certificate: UnknownIssuer

Are you behind a corporate firewall? Can you set `DENO_TLS_CA_STORE=system` and try again?

yes and thanks so much. that did the trick!

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#39

I've been writing a simple single page form app the past few days and I like Fresh a lot. I really appreciate the simplified project layout vs my last setup of a react app project nestled in a parent express project. It just makes the devops, if you would even called it that, of writing a one-person full stack app easier. Deno running TypeScript without a compile to JS adds to this. I'm happy to see the Preact Signal…

Thanks for the kind words!

this update fixed all the drawbacks I experienced while building my webpage: www.hazn.deno.dev

Fresh and deno are the embodiment of: ergonimic, performant, secure — pick three.

thank you (and all the contributors) for your work :)

Re: Fresh 1.1 – Automatic JSX, plugins, DevTools, and more

#40

Hey folks, author of Fresh here. Very excited for this rather significant release. Happy to answer any questions you may have :)

I'd be interested to see a more built in solution for Markdown and MDX, as with Astro or NextJS, since I've been mainly using either for blog type websites and I'd love to use Fresh as well.

It's my understanding that GFM is already easy to do, in fact there's an example of using it with Fresh in the fresh repository as it's used for the docs!

https://github.com/denoland/fresh/blob/main/www/routes/docs/...

Using MDX is a little trickier as the .mdx file needs to be compiled to a javascript file which is then interpretted. When running Deno yourself this isn't hard as you can use a dynamic import, but if you're planning on using Deno Deploy you'll be out of luck as it doesn't support dynamic imports currently.

https://github.com/denoland/fresh/issues/640

Deno Deploy has an open issue asking for support if you want to give it a star. ;)

https://github.com/denoland/deploy_feedback/issues/1

As a workaround, you can always setup a watcher and preprocess MDX files before deploying to Deno Deploy, but that seems against the spirit of what Fresh is trying to accomplish by getting rid of preprocessors.

Let me know if you figure out a way to get MDX on Deno Deploy working without precompile as I'd like to use it myself!

Post reply on HN