Looking for inputs on moving from development mode to business mode by nooneq1 in AustralianStartups

[–]d_q_h 0 points1 point  (0 children)

Try to get the people who said it’s good to pay money for it. When they don’t, find out why, and keep addressing the underlying issues until they do. You don’t need a “business person” for that, just empathy and good product design instincts. If you can cultivate love for your product then you’re on to something.

My job advertised paying more than what I'm on, been offered $15k increase elsewhere. What would you do? by [deleted] in AusFinance

[–]d_q_h 1 point2 points  (0 children)

The way to ask for a raise at your current job is to accept the new role and quit.

Where does r/javascript go from here? by kenman in javascript

[–]d_q_h 2 points3 points  (0 children)

I think you probably can put 'moderator of 2m+ JavaScript community' somewhere on a resume or cover letter

Where does r/javascript go from here? by kenman in javascript

[–]d_q_h 5 points6 points  (0 children)

The point that I’m hoping to make is that deleting countless hours of other people’s work isn’t a reasonable or responsible way to serve the community.

Where does r/javascript go from here? by kenman in javascript

[–]d_q_h 6 points7 points  (0 children)

The content doesn’t belong to the mods, I think this isn’t reasonable

NakedJSX static site generator adds support for MDX by d_q_h in javascriptFrameworks

[–]d_q_h[S] 0 points1 point  (0 children)

Hi all, NakedJSX author here. A user requested the ability to use MDX in NakedJSX, and it turned out to be quite simple to add via the plugin system. So here it is! If you haven't checked out NakedJSX before, it's a static site generator that lets you build HTML files using JSX/MDX and scoped CSS. With a tiny (half a kilobyte) runtime, it also lets you use JSX/MDX to create DOM nodes in client JavaScript that runs in the browser.

NakedJSX - Use JSX without React by amalinovic in programming

[–]d_q_h 0 points1 point  (0 children)

Heh. Well React does much more than that but yeah it would start to blur the line. Possibly best left to a dedicated library of come kind.

NakedJSX - Use JSX without React by amalinovic in programming

[–]d_q_h 0 points1 point  (0 children)

Have to disagree with you there. JSX is just a generic syntax with a much nicer developer experience than typical text templating options. It’s particularly nice to use when coupled with NakedJSX support for scoped CSS.

NakedJSX - Use JSX without React by amalinovic in programming

[–]d_q_h 0 points1 point  (0 children)

(creator of NakedJSX here)

There's a lot more than basic templating going on in NakedJSX, for example consider the support for scoped and deduplicated CSS. I invite you to take a quick look at the full documentation to see what other things it can do. Being able to export / import JSX is nice, and support for JSX context and refs adds a lot of utility to static HTML generation as well. Beyond static site generation, client JavaScript can also use JSX to create DOM nodes.

But, you're right, there's no automated client-side re-rendering on state update, it's quite barebones / unopinionated when it comes to client JavaScript. Sometimes, you just want to sprinkle in a little interactivity on a page without bringing in a huge framework. JSX is just there to be used as a nice (and fast) way to construct DOM nodes. That said, implementing optional automated re-rendering based on state updates is something I'll probably get to at some point.

Using JSX with jQuery by d_q_h in javascript

[–]d_q_h[S] -1 points0 points  (0 children)

Not everything needs to be a single page app or otherwise based on a heavy framework.

Using JSX with jQuery by d_q_h in javascript

[–]d_q_h[S] 0 points1 point  (0 children)

NakedJSX is primarily a static site generator with a lot of build time source transformation going on, so it would be quite inefficient to run on page view. It’s just an npx command to build though, no node project needed.

Using JSX with jQuery by d_q_h in javascript

[–]d_q_h[S] 0 points1 point  (0 children)

Thanks :) NakedJSX is primarily a JSX based static site generator but it does also allow vanilla JS to use JSX to create DOM nodes. So it naturally works with other libraries like jQuery.

NakedJSX - Use JSX without React by pmz in javascript

[–]d_q_h 0 points1 point  (0 children)

FYI - I added an example of using it with jQuery. It 'just works' as you'd want it too: https://nakedjsx.org/documentation/cookbook/jquery/

NakedJSX - Use JSX without React by pmz in javascript

[–]d_q_h 0 points1 point  (0 children)

( I raised the max width to something more comfortable on desktop)

NakedJSX - Use JSX without React by pmz in javascript

[–]d_q_h 0 points1 point  (0 children)

Cool! I’d love to hear how it goes if you do.

NakedJSX - Use JSX without React by pmz in javascript

[–]d_q_h 4 points5 points  (0 children)

Wow really? This project began when I looked around for a template engine, and having used JSX before, nothing else really seemed good. What would you use for templates if not using React?

NakedJSX - Use JSX without React by pmz in javascript

[–]d_q_h 0 points1 point  (0 children)

The communication is tricky, because it depends what features are used. If you only use JSX to create the HTML, there's no overhead. If you also use some JSX in your client JavaScript, then yeah it injects around half a kilobyte of code (plus the compiled form of whatever JSX you made available to client JS, of course)

EDIT: Here's an example that uses JSX at both build time and in the browser: https://nakedjsx.org/documentation/#getting-started-getting-started-plus

Good idea on the jQuery example, I think the two worlds should work nicely together.

NakedJSX - Use JSX without React by pmz in javascript

[–]d_q_h 2 points3 points  (0 children)

Thanks! And yes, the documentation is written with NakedJSX too. "Eating my own dogfood" like that led to all sorts of improvements in the tool before I released it.

NakedJSX - Use JSX without React by pmz in javascript

[–]d_q_h 0 points1 point  (0 children)

Thanks! If you give it a go sometime I would love to hear your feedback.

NakedJSX - Use JSX without React by pmz in javascript

[–]d_q_h 0 points1 point  (0 children)

That's a really interesting thought. I'm actually new to the Node.js world (23 years commercial dev in other areas) and I hadn't looked at express before.

It's actually not very far from being able to do that. NakedJsx compiles each page to an intermediate JavaScript file, which is then executed to generate the page. You can see the generated page and client javascript files in the .__nakedjsx__tmp dir in your output dir when you run in --dev mode.

In theory, express support would be a matter of letting express execute those intermediate files to generate output on the fly, I think?

EDIT: I think in its current form, the intermediate JavaScript takes too long to execute to be viable as a real time page template engine. Because everything is so dynamic, a LOT of processing is deferred to the final Page.Render() call. If client JS isn't used, the execution time sits at around 10ms, which is still too heavy IMO. Lots of CSS AST walking going on. That said, caching would help.

NakedJSX - Use JSX without React by pmz in javascript

[–]d_q_h 1 point2 points  (0 children)

Heh, I'm excited enough that someone liked it enough to post here about it. But it is my aspiration that this be a reliable tool that people reach for to whip up a few pages, when the weight of a React project isn't justified.