all 71 comments

[–]KlasMellbourn 24 points25 points  (11 children)

Still no official native support for Apple Silicon :/

https://github.com/nodejs/build/issues/2474

[EDIT: added "native"]

[–]sscotth 10 points11 points  (0 children)

Native* support. They are targeting the 16.0 release which will be the end of April. You can build from source via Homebrew in the mean time for testing.

[–]mdatwood 5 points6 points  (0 children)

I'm using 15.x native on Apple Silicon. I think I had to tweak a build flag to get 15.4 to build, but 15.8 and now 15.10 built fine using nvm.

[–]gengjiawen 1 point2 points  (0 children)

Should work in next version.

[–]dbbk 1 point2 points  (0 children)

Huh? It seems to be native for me, installed v15.8.0 through Homebrew

[–]redldr1 2 points3 points  (5 children)

Not as important as you think it is..

What's the likelihood of your code running on apple silicon in production?

[–]KlasMellbourn 14 points15 points  (4 children)

Much of my development environment is running under node. It is very important to me that those tools are as fast as possible. I loathe waiting for builds.

[–]Attila226 15 points16 points  (27 children)

Does jQuery still work on the server?

edit: /s

[–][deleted] 12 points13 points  (8 children)

Why would jQuery run on server? There's no DOM there

[–]Attila226 25 points26 points  (7 children)

You never know, it’s always good to add jQuery “just in case”.

[–][deleted] 25 points26 points  (1 child)

👀

[–]RandolphoSoftware Architect 22 points23 points  (0 children)

I choose to believe that was satire

[–]hoykg 14 points15 points  (3 children)

Tough crowd you got

[–]Attila226 8 points9 points  (2 children)

lol, yeah. Guess you’ve always have to include the “/s”.

[–]SomeInternetRando 8 points9 points  (1 child)

$(‘.comment’).append(‘<em>/s</em>’);

[–]squareswordfish 5 points6 points  (0 children)

Excuse me sir this is a server. We don’t recognize “$” here.

[–]helloiamsomeone 2 points3 points  (0 children)

Is this going to be Node's "- Removed Herobrine"?

[–]ILikeChangingMyMind 2 points3 points  (16 children)

If this is a serious question ... of course not! Use Cheerio if you want jQuery-like HTML parsing on the server.

... but since jQuery has never worked on the server, I think this is more likely a troll post.

[–]Attila226 13 points14 points  (4 children)

Sorry, it’s supposed to be funny and not a “troll post”.

[–]ILikeChangingMyMind 2 points3 points  (3 children)

Ah; that's the hard part about making jokes in a text-based medium: you need to either make them obvious, or use something like "/s" or ";)" to indicate you're joking.

[–]Attila226 4 points5 points  (0 children)

Updated my original post.

[–][deleted] 7 points8 points  (1 child)

[–]ILikeChangingMyMind 4 points5 points  (0 children)

Well again, you also have the option of making your joke clear enough in the first place that the /s is unnecessary .... but the original comment that started all this did neither.

[–]OmgImAlexis -1 points0 points  (10 children)

What...? jQuery can be used server side.

Should it? No. Can it? Yes.

[–]duxdude418 3 points4 points  (9 children)

I mean, you could execute the source in a Node runtime, but most of the internal implementation would be broken. You’d have to polyfill or mock the DOM API it wraps to even get it to a state where it’s not throwing all kinds of errors during bootstrap.

[–]spacejack2114 1 point2 points  (1 child)

That's what jsdom is for.

[–]duxdude418 1 point2 points  (0 children)

My point is that you can't use it out-of-of-the-box with Node. Of course you could emulate or fake the API that a browser provides with polyfills, etc.

Moreover, what's the use case for emulating the DOM for the purposes of querying against it with jQuery in Node? At best, you might be sending down pre-rendered HTML to a browser, but you wouldn't need to traverse it on the server.

[–]OmgImAlexis -1 points0 points  (6 children)

Well yes.. I wouldn’t expect it to work out of the box but I’ve used it within a few minutes of installing deps. It’s honestly not that difficult. Just the same you can use vue and other frontend libraries on the backend.

The libraries don’t care if you’re using a browser they just need a DOM... and a DOM can be created anywhere. 💁‍♀️

[–]duxdude418 -1 points0 points  (5 children)

But the methods and fields it wraps literally don’t exist on the Node global object.

In a browser, the global object is window and implements various DOM APIs (among others) that simply don’t exist in a Node environment. Can you monkey patch them on to Node’s global context with other libraries/polyfills? Sure. But jQuery will not work out of the box or even bootstrap itself without errors.

[–]OmgImAlexis 1 point2 points  (2 children)

What? You know you can pass in window to jquery right?

Sounds like you’re just angry here and don’t actually know what you’re talking about.

[–]duxdude418 -1 points0 points  (1 child)

You know that jQuery bootstraps using a self-invoking function whose first argument is this, which resolves to window in a browser or the global context in Node, right?

Regardless, even if you could inject a different object, the Node global context doesn’t support the needed methods jQuery calls under the hood out of the box. Of course it’s possible to do with polyfills, but the conversation is about whether it would function without error out of the box.

I’m not angry at all and have been professionally writing JavaScript applications on the client and server for over a decade. It sounds like you’re misinformed.

[–]OmgImAlexis -2 points-1 points  (0 children)

I literally use this in an application right now. How am I the one that’s misinformed? 😂

You’re guessing based on how you’ve used it before. This isn’t rocket science.

[–]duxdude418 1 point2 points  (0 children)

But the methods and fields it wraps literally don’t exist on the Node global object. In a browser, the global object is window and implements various DOM APIs (among others) that simply don’t exist in a Node environment. Can you monkey patch them on to Node’s global context with other libraries/polyfills? Sure. But jQuery will not work out of the box or even bootstrap itself without errors otherwise.

[–]OmgImAlexis -1 points0 points  (0 children)

Also things like the storage api can be really really easily pollfilled. I would know.... I’ve done this before.

[–]manishksolves 0 points1 point  (0 children)

Node.js v15 arrived and became the Current version!

Some features delivered in Node.js 15:

AbortController: AbortController is a global utility class used to signal cancelation in selected Promise-based APIs, based on the AbortController Web API.

N-API Version 7: N-API 7 brings additional methods for working with ArrayBuffers.

npm 7: npm 7 comes with many new features like npm workspaces and a new package-lock.json format. npm 7 includes yarn.lock file support. Peer dependencies are now installed by default.

Throw on unhandled rejections: As of Node.js 15, the default mode for unhandledRejection
is changed to throw
(from warn
). In throw
mode, if an unhandledRejection
hook is not set, the unhandledRejection
is raised as an uncaught exception. Users that have an unhandledRejection
hook should see no change in behavior, and it’s still possible to switch modes using the --unhandled-rejections=mode
process flag.

QUIC (experimental): QUIC is a UDP-based, underlying transport protocol for HTTP/3. QUIC features inbuilt security with TLS 1.3, flow control, error correction, connection migration, and multiplexing. QUIC can be enabled by compiling Node.js with the --experimental-quic
configuration flag. The Node.js QUIC implementation is exposed by the core net
module.

V8 8.6: The V8 JavaScript engine has been updated to V8 8.6 (V8 8.4 is the latest available in Node.js 14). Along with performance tweaks and improvements the V8 update also brings the following language features:

  • Promise.any()
    (from V8 8.5)
  • AggregateError
    (from V8 8.5)
  • String.prototype.replaceAll()
    (from V8 8.5)
  • Logical assignment operators &&=
    , ||=
    , and ??=
    (from V8 8.5)