New developers must write HTML page to load in their browser to test
their code. WTF? This isn't good practice for serious development.
Imagine if you had to learn XML before you could run your Python code.
You can use Node to execute js outside the browser. I think this is
completely missing the point. Node is all about server-side js. What
about plain js? I don't want to have to open Chrome, I don't want to have
node inheritance_example.js. I want to run:
inheritance_example.js. This opens up a complete new word of
window = require('window'); window.elementById("#foo"); // in tests you could to this. // no need for a browser, you only care about the DOM. // all you care about is generating HTML. Rendering and displaying is a // separate responsiblity. window = require('window/mock');
I think this would be utterly fantastic. It would make every aspect of js development much easier. This is also the first step to making js a first class language. A standard library could be built and more progress could be made.
First Class Modules
I think everyone agrees that js needs support for
(some concept of a load path). This implies support for discrete source
files with (hopefully) discrete functionality. Most other programming
languages have support this. Structuring HTML or using other tools
to compile js into one file is just annoying and wrong. There
are many solutions to these problems:
and Modules in ECMA6.
Developers must come a solution for this to make js development.
Disclaimer: I don't think involving the browser is a good solution.
One possible solution is to simply treat to put "./" on the load path.
The js VM simply has to have read access to files in that directory.
It's common practice to package js applications as a single directory.
The browser's VM's responsibility to make files available over HTTP.
For example: say you have this directory structure:
./ - controllers.js - models.js - views.js - app.js
// one version controllers = require('controllers'); // EMCA6 import * from controllers;
app.js would work fine outside the browser and inside the browser.
Standard Testing Framework
Notable editions for better testing: test coverage tools, a good mock/stubbing framework, a good factory library, and support for mutation testing.
Change The Culture
Shameless Plug: Here's what I think serious js developers should be working toward.
— Adam Hawkins