Skip to content

Releases: ericmdantas/generator-ng-fullstack

1.8

04 May 01:09
Compare
Choose a tag to compare

This version was mostly created to improve the separation of concerns of the generated app. Different parts were already easily decoupled, but the user had to do it by hand, so we decided to help you.

The generator is being used like never before, different people with different skills and different contexts have joined and we have to try to help everybody, here's how this version went:

Separated Static Server

Now, there's an option to use a different server for static files. Before such change, if you wanted to have Nginx serving your static files, you'd have to create the app and remove some files by hand, right now this is done automagically when you answer the question: Do you want to use a different static server? Such as nginx, apache, IIS?'. Keep in mind the generator doesn't give you any config file for such static server, it just removes the reponsability from the server.

Initial support for Cordova

Some people asked for this one (first talked to @bernardbr), mostly because it seemed to be pretty straight forward to turn the generated files into a "Cordova friendly" type of app. So, we created an option Are you using Cordova (for mobile development)? to help you with the boilerplate. Few things change in the application, really. Between the changes: removes <base href="/" />, adds <meta .../> specific for Cordova, adds cordova.js in index.html and uses html5Mode(false).

One point, though: such option only shows up when you choose a client only app and ng1; ng2 is not supported yet.

Security

Do not serve files from the root anymore.

To make things easier for Angular 2 people, we don't use many magic bundlers and suchs. The problem is that that makes us look for dependencies inside node_modules directly, and we had to map the root in the static middleware to have access to such folder.

That doesn't happen anymore when you have a fullstack app. Now, the paths served are: client/dev (dev), client/dist (dist) and node_modules (both dev and dist).

Such changes lead to changing the way Angular 2 components reach out to templateUrl and styleUrls. Before we'd have: client/dev/todo/templates/todo.html and now we have todo/templates/todo.html.

Same happened to the deps in index.html.

  • Before: <script src="node_modules/angular2/bundles/angular2.js?rev=@@hash"></script>;
  • After: <script src="./angular2/bundles/angular2.js?rev=@@hash"></script>.

Single option to run server and client watcher

As suggested by @georgeedwards, we're now using concurrently, a module that let us run npm start (to start server) and npm run watch (to open browser and watch client).

All you have to do is run the following:

  • Fullstack app: npm run dev (starts server and starts browser with watcher);
  • Server app: npm start (starts server);
  • Cliente app: npm start (starts browser with watcher);

Protections and bug fixes

A bunch of protections and bug fixes were taken care of, thanks everybody who reported issues and gave feedbacks.

Next steps

Some of the changes are pretty straight forward, but depend on external modules, such as:

Others are a bit more vague and I've got to study them before createing new subgenerators and suchs.

Known issues going forward

Happy coding!

1.7

31 Mar 10:16
Compare
Choose a tag to compare
1.7

Release 1.7.0 is all about making your server secure. And for that, we introduced the new version of the Http protocol: Http/2.

We introduced the option for you to have a secure server or not - for the secure, we're heading to Http/2 and not only https.

All you have to do is answer the question: 'Do you want a secure app (http/2)?' and then BOOM! You've got yourself a secure server.

The certs (generic ones, borrowed from aliv) will be placed in the server folder and will be used to make the secure part of your app. If you want to change the certs, just go to the folder server/cert and change the files.

Node

There's a known issue between Node's Express and the Http/2 module (here), so, for now, Node's sticking to https.

Go

Go http2 server is working smoothly. In Go, if you're working with https, you're working with Http/2 - so, after we configured the secure server, Http/2 was enabled by default.

Keep in mind that's only available to Go 1.6 and higher.


Other changes

  • Creates wiki for deploying in heroku, with both MongoHQ and MongoLab;
  • Changes server start command for heroku in procfile.txt;
  • Removes unecessary deps and updates module versions;
  • Adds more tests;

Resources

Http/2 explained - by Daniel Stenberg
Http/2 in go - by Brad Fitzpatrick

Known issues with 1.7

Fix typings in typescript server

1.6

14 Mar 02:28
Compare
Choose a tag to compare
1.6

This a major release for ng-fullstack.

The generator was pretty much rewritten from bottom up, so things are easier to maintain in the long run.

There's much more to come, but a lot of stuff was already added in this version, let's get to it!

Improved wiki

Thanks to @georgeedwards, we've got an easier to follow wiki page. Since it's a place where new comers go to check how the generator works, it was critical to improve it.
We've got more stuff to put there, but I really like where it's going.

Http2 ready

Since the generator was created to be in the bleeding edge of awesome stuff out there, we always kept an eye on http2. And hey, it can be used in many cases already. So, for this version of the generator, we focused on having the build ready for http2.

Better build structure

Until now, we had a single gulpfile.js with all our tasks. build_css, build_js, build_html, etc. It was all in the same messy file.

For 1.6, we split the tasks in different files, they live in the tasks folder and, obviously, are much easier to maintain and to extend.

Also, to make it easier to scale, we put the task names in a const file, so it's easier to use the same task in different files.

Angular 2 integration

Angular1 is part of the core of the generator since its birth, and there's still a lot of people using it out there, so, it's not going anywhere.

But, since Angular2 started to be developed, we wanted to have it in the generator as soon as possible. And here it is - one option away and you'll be working with Angular2.

Client and Server only option

Even though the name of the project is ng-fullstack, I think it could be too much for some projects to have both client and server side generation - sometimes, you already have the server ready or you already have the client ready and you only want to use one or the other. So, now you can simply answer a question in the generator and get a client only app. You'll still have the gulp tasks and your client will be powered by aliv - a new and powerful alive server.

Full client module

When you're creating an application from zero, you'd have to create every module and its stuff separated, like: $ yo ng-fullstack:controller user --feature user, $ yo ng-fullstack:service user --feature user, $ yo ng-fullstack:directive user --feature user, etc. But, that could be better. Thinking about that, we created the module subgenerator.

When you run $ yo ng-fullstack:module user --feature user, you'll get:

client/dev/family/factory/user.js
client/dev/family/services/user.js
client/dev/family/models/user.js
client/dev/family/controllers/user.js
client/dev/family/directives/user.js
client/dev/family/styles/user.css
client/dev/family/templates/user.html

tests/client/family/factory/user_test.js
tests/client/family/components/user_test.js
tests/client/family/services/user_test.js
tests/client/family/models/user_test.js
tests/client/family/directives/user_test.js

Better consistency between generated files

One of the things that are incredible annoying is when some generators try to help you to generate a file, but then it either screws up its or its file name. We decided to resolve it by taking by granted the name you give us; for example, if you run $ yo ng-fullstack:controller something --feature something, you'll get a something file with the name something inside of it, no sufix.

Much more

Since 1.5, many things were improved and fixed. But the above are the highlights.

Road to 1.7

  • HTTP/2 - this is the priority of the version. we'll attack the http2 way. We'll implement the http2/https server for node and for go and make the build even better to support it;
  • PassportJS - we might also have an option to generate a boilerplate for PassporteJS integration;
  • src/test - Side by side source and test files, golang style.

Known issues with 1.6

Fix typings in typescript server