Live data from Hacker News

Adonis.js v2 released – Laravel for Node.js

adonisjs.com

11–20 of 28 posts

Re: Adonis.js v2 released – Laravel for Node.js

#11

Earlier quoted context omitted.

Agree. Especially in a language like Javascript. For testing - var myLib; if(process.env.NODE_ENV === "test") { myLib = require("../test/my_test_lib") } else { myLib = require("./my_lib") } or similar (you can obviously tighten this code up, too; I'm just being very explicit). Tada, you're injecting your test stubs in place of the real library when running in test. For the actual production use that a DI framework gi…

There's also stuff like rewire [0], which lets you change required values inside modules. Although every time I've tried it, I found it created more problems than it was solving. [0] https://www.npmjs.com/package/rewire

Proxyquire - https://github.com/thlorenz/proxyquire - is a nicer way to solve many of the problems that people tend to use rewire for.

We use it to stub out imports in our unit tests and find it very easy.

Re: Adonis.js v2 released – Laravel for Node.js

#15
Curious why the authors did not choose to use Babel+ES7 async/await instead of generators.

The discussion in this ESDiscuss thread (https://esdiscuss.org/topic/does-async-await-solve-a-real-pr...) points to multiple advantages of embracing Async/Await over generators for asynchronous code.

Re: Adonis.js v2 released – Laravel for Node.js

#16
nope. I'm done. There are enough JS frameworks, client and server side. I don't need to look at another one.

I'd really like 2016 to be the year that everyone who thought of making another new JS framework decided to not do that and instead go fix bugs in one of the existing ones that people are already using.

Re: Adonis.js v2 released – Laravel for Node.js

#17

This is sorta tangentially related... I used to think DI was a good idea, but as I've gotten more experience... I'm no longer convinced using a DI framework nets you huge wins relative to the added complexity. My hypothesis is that good design can remove the need for a DI framework in many cases, or at least that's been my experience so far. Maybe I just haven't worked in an application that's big and complicated eno…

Disagree with the DI/IoC comments - for more complex projects, it allows dependencies to be pulled in in a nice terse and readable fashion. Runtime complexity also can be harder to manage, as it often ends up in a spaghetti of knowledge in scattered code. DI isn't a particularly complex construct to grasp.

The benefits of mocking are often understated - it is not only to isolate logic, but for longer term maintenance, it is for also easily being able to detect what change breaks what part of the code. When people write more integration tests than unit tests (I have found many developers guilty of this), what often ends up happening is that when someone breaks one of those tests due to having to change behavior of code from new business requirements or maintenance (i.e. abstracting out common behavior), it can become very tricky to untangle what exactly broke, and how to fix it. Not that there isn't value in those types of tests, but without being paired with more controlled unit tests, there is a huge con that hampers productivity of teams.

Ideally, one should have the ability to easily mock and make testing each piece painless & clear, so that finding bugs/breaking changes can be made clearly and consciously. Not all tests need to mock, but having that level of control greatly helps on stable & quick iteration of code.

Re: Adonis.js v2 released – Laravel for Node.js

#18
post #15

Curious why the authors did not choose to use Babel+ES7 async/await instead of generators. The discussion in this ESDiscuss thread ( https://esdiscuss.org/topic/does-async-await-solve-a-real-pr... ) points to multiple advantages of embracing Async/Await over generators for asynchronous code.

I can't speak for the author, but it may be for simplicity's sake.

Personally I would have still have gone Babel+* but a Babel transpilation pipeline adds a non-negligible level of complexity to a project, especially when it comes to debugging/performance optimisation.

Re: Adonis.js v2 released – Laravel for Node.js

#19
post #5

Interesting. This was also announced yesterday: https://github.com/trailsjs/trails

It is interesting comparing the divergent chains of evolution:

Rails inspired ASP.net MVC inspired Laravel inspired Adonis

wrt.

Rails inspired Sails inspired Trails

Good to see the spirit of CoC and elegant pragmatism being carried forward.

Re: Adonis.js v2 released – Laravel for Node.js

#20
post #14

Laravel is a fantastic PHP framework, so if this is even close to as good for JavaScript it is worth checking out.

Yes. Laravel is very coherent php framework. But it seems there is no need php in future since ES6

Yeah, once the full spec of ES6 is supported by all _browsers_, we will see that overnight, all legacy PHP will disappear and everyone will stop developing with PHP. The PHP runtimes magically transform themselves into Node.js and all is well in the realm of web. Behold the day of the rapture.js.
Post reply on HN