Live data from Hacker News

Node v8.1.2

nodejs.org

11–20 of 49 posts

Re: Node v8.1.2

#11

I upgraded a universal React/typescript project from node 6.10 to 8.1 this week. Configured typescript compilation in webpack to target es2017 server-side and es5 client-side. It worked flawlessly. Debugging async functions (server-side) is a lot better now that there is no transpiler mangling my code beyond recognition.

Would you mind sharing your tsconfig(s)? And also do you use sourcemaps on the server?

Re: Node v8.1.2

#12
post #2

Node 8 is the planned LTS release for later this year. Notably, it brings async/await syntax to vanilla JS. This new feature complements callbacks and largely replaces how Promises are currently consumed (opting for sequential-like execution with try/catch blocks instead of Promise chains). The closest analogue would be Tasks in C#. EDIT: removing reference to node-v8 to prevent confusion.

Promises are and always were retarded. They did nothing to alleviate callback hell which was most of the point of their existence. I have no idea why they implemented them instead of async/await in the first place. Now we have to deal with mixing both for years.

Another fine example of JavaScript trying to be hip and ignoring the lessons learned from countless other languages over the years.

I see this constantly with JS like with the 3+ ways to check for NaN and the object "freeze" system that doesn't actually make objects immutable. They take a solid concept from other languages then put a snazzy spin on it that makes it fucking useless. Then try again in the next version. JS library and syntax is littered with corpses of failed experiments.

At least they finally have a usable ForEach loop after three attempts.

Please typescript save us from this hubris.

Re: Node v8.1.2

#13
post #4
post #2

Node 8 is the planned LTS release for later this year. Notably, it brings async/await syntax to vanilla JS. This new feature complements callbacks and largely replaces how Promises are currently consumed (opting for sequential-like execution with try/catch blocks instead of Promise chains). The closest analogue would be Tasks in C#. EDIT: removing reference to node-v8 to prevent confusion.

Aync/await is the best thing since sliced bread. It has made my life so much easier.

I started using Async/Await and liked it, but I've been learning more about functional programming and went back to Promises

Re: Node v8.1.2

#15

I upgraded a universal React/typescript project from node 6.10 to 8.1 this week. Configured typescript compilation in webpack to target es2017 server-side and es5 client-side. It worked flawlessly. Debugging async functions (server-side) is a lot better now that there is no transpiler mangling my code beyond recognition.

Would you mind sharing your tsconfig(s)? And also do you use sourcemaps on the server?

This is my tsconfig.server.json:

   {
      "files": [],
      "compilerOptions": {
        "baseUrl": ".",
        "moduleResolution": "node",
        "target": "es2017",
        "jsx": "react",
        "experimentalDecorators": true,
        "sourceMap": true,
        "skipDefaultLibCheck": true,
        "lib": [ "es2017", "dom" ],
        "allowJs": false,
        "paths": {
          "*": [ "./ClientApp/types/*", "*" ]
        }
      },
      "exclude": [
        "bin",
        "obj",
        "node_modules"
      ]
    }
edit: remove unneeded entries

Re: Node v8.1.2

#16

Now's as good a time as any to ask: What tools do you folks use to monitor your node dependencies and make sure you are keeping everything up to date?

npm outdated -l

But in addition to that, how do you "update all and bump relevant package.json entries, dependencies _and_ devDependencies as appropriate" ?

`npm update --save` or `npm update --save-dev` say explicitly "save updates to `dependencies` resp. `devDependencies`", which causes duplication between dependencies and devDependencies. (Say you have a dep foo and a devDep bar and both are outdated: `npm update --save` will bork package.json with an additional incorrect dep bar, and `npm update --save-dev` will bork it with an additional incorrect devDep foo :-/ )

Am I missing something? I understand there are 3rd-party packages providing such functionality, but is there any reason to not cover this feature in npm?

Re: Node v8.1.2

#17

Now's as good a time as any to ask: What tools do you folks use to monitor your node dependencies and make sure you are keeping everything up to date?

I just regularly run `yarn upgrade-interactive` in my projects.

I was thinking of making dependency-updates part of the CI-pipeline, using a 'allow_failure'-flag. However, if you decide not to upgrade a dep for some reason, this will cause each and every build to throw a warning.

Re: Node v8.1.2

#18
post #2

Node 8 is the planned LTS release for later this year. Notably, it brings async/await syntax to vanilla JS. This new feature complements callbacks and largely replaces how Promises are currently consumed (opting for sequential-like execution with try/catch blocks instead of Promise chains). The closest analogue would be Tasks in C#. EDIT: removing reference to node-v8 to prevent confusion.

Promises are and always were retarded. They did nothing to alleviate callback hell which was most of the point of their existence. I have no idea why they implemented them instead of async/await in the first place. Now we have to deal with mixing both for years. Another fine example of JavaScript trying to be hip and ignoring the lessons learned from countless other languages over the years. I see this constantly wit…

You do realize that implementing promises is a prerequisite for async/await, right?

Re: Node v8.1.2

#19
post #2

Node 8 is the planned LTS release for later this year. Notably, it brings async/await syntax to vanilla JS. This new feature complements callbacks and largely replaces how Promises are currently consumed (opting for sequential-like execution with try/catch blocks instead of Promise chains). The closest analogue would be Tasks in C#. EDIT: removing reference to node-v8 to prevent confusion.

Promises are and always were retarded. They did nothing to alleviate callback hell which was most of the point of their existence. I have no idea why they implemented them instead of async/await in the first place. Now we have to deal with mixing both for years. Another fine example of JavaScript trying to be hip and ignoring the lessons learned from countless other languages over the years. I see this constantly wit…

You do realise that async/await is basically syntactic sugar for promises in JS, don't you?

Re: Node v8.1.2

#20
post #6

Earlier quoted context omitted.

Are they still calling it 'v8' instead of 8? Also notable is that async/await isn't new for node, 7.10 supported it (and previous versions with a flag). It's new for a LTS release. What is new, however, is the in-built util.promisify that can convert callbacks into native promises.

They dropped the "v" from the version name. Yeah, a lot of companies won't touch non-LTS Node though, so a lot of users won't use async/await until later this year when the next LTS is released (Oct 2017).

They dropped the "v" from the version name.

Except in their official release blog posts, it seems :-D

Post reply on HN