Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Commit

Permalink
Merge 953d6ec into bb5aab5
Browse files Browse the repository at this point in the history
  • Loading branch information
akanass committed Sep 25, 2018
2 parents bb5aab5 + 953d6ec commit c2f52ce
Show file tree
Hide file tree
Showing 3 changed files with 815 additions and 347 deletions.
32 changes: 24 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This is a [Hapiness](https://github.com/hapinessjs/hapiness) Engine for running

This story will show you how to set up Universal bundling for an existing `@angular/cli`.

We support actually `@angular` `@6.1.0` and next so you must upgrade all packages inside your project.
We support actually `@angular` `@6.1.8` and next so you must upgrade all packages inside your project.

We use `yarn` as package manager.

Expand Down Expand Up @@ -85,7 +85,6 @@ Install [Hapiness](https://github.com/hapinessjs/hapiness) modules into your pro
> You also need :
> - `ts-loader` and `webpack`, `webpack-cli` for your webpack build we'll show later and it's only in `devDependencies`.
> - `@nguniversal/module-map-ngfactory-loader`, as it's used to handle lazy-loading in the context of a server-render. (by loading the chunks right away)
> - `rxjs-compat`, until `@hapiness/core` is migrated to `rxjs` v6.

```bash
Expand Down Expand Up @@ -317,7 +316,7 @@ At the ROOT level of your project (where package.json / etc are), created a file
// These are important and needed before anything else
import 'zone.js/dist/zone-node';
import 'reflect-metadata';
// * NOTE :: leave this until @hapiness/core will be migrated to rxjs v6
// * NOTE :: leave this until @hapiness/core will be migrated to rxjs v6 - This library is installed automatically
import 'rxjs-compat';

import { enableProdMode } from '@angular/core';
Expand Down Expand Up @@ -435,9 +434,14 @@ const path = require('path');
const webpack = require('webpack');

module.exports = {
// Temporary fix for issue: https://github.com/angular/angular-cli/issues/10787#issuecomment-388512231
mode: 'none',
entry: { server: './server.ts' },
resolve: { extensions: ['.ts', '.js'] },
target: 'node',
resolve: { extensions: ['.ts', '.js'] },
optimization: {
minimize: false
},
// this makes sure we include node_modules and other 3rd party libraries
externals: [/(node_modules)/],
output: {
Expand All @@ -446,7 +450,13 @@ module.exports = {
},
module: {
rules: [
{ test: /\.ts$/, loader: 'ts-loader' }
{ test: /\.ts$/, loader: 'ts-loader' },
{
// Mark files inside `@angular/core` as using SystemJS style dynamic imports.
// Removing this will cause deprecation warnings to appear.
test: /(\\|\/)@angular(\\|\/)core(\\|\/).+\.js$/,
parser: { system: true },
}
]
},
plugins: [
Expand All @@ -460,17 +470,17 @@ module.exports = {
new webpack.ContextReplacementPlugin(
/(.+)?hapiness(\\|\/)core(.+)?/,
path.join(__dirname, 'src'),
{}
),
new webpack.ContextReplacementPlugin(
/(.+)?hapiness(\\|\/)ng-universal(.+)?/,
path.join(__dirname, 'src'),
{}
)
],
stats: {
warnings: false
},
// Temporary fix for issue: https://github.com/angular/angular-cli/issues/10787#issuecomment-388512231
mode: 'none'
}
};
```

Expand Down Expand Up @@ -541,6 +551,12 @@ To set up your development environment:
[Back to top](#table-of-contents)

## Change History
* v6.2.0 (2018-09-24)
* `Angular v6.1.8+`
* Latest packages' versions
* Install automatically `rxj-compat@6.2.2` to be compatible with all `Hapiness` extensions
* Update doc of [webpack.server.config.ts]((#webpackserverconfigjs-root-project-level)) to match with latest version of `Angular Universal` [story](https://github.com/angular/angular-cli/wiki/stories-universal-rendering#webpackserverconfigjs-root-project-level)
* Documentation
* v6.1.0 (2018-07-26)
* `Angular v6.1.0+`
* Documentation
Expand Down
49 changes: 24 additions & 25 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hapiness/ng-universal",
"version": "6.1.0",
"version": "6.2.0",
"description": "This is a Hapiness Engine for running Angular Apps on the server for server side rendering.",
"main": "index.js",
"types": "index.d.ts",
Expand Down Expand Up @@ -75,47 +75,46 @@
},
"homepage": "https://github.com/hapinessjs/ng-universal-module#readme",
"dependencies": {
"@types/node": "^10.5.3"
"@types/node": "^10.10.3",
"rxjs-compat": "~6.2.2"
},
"devDependencies": {
"@angular/animations": "^6.1.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/compiler-cli": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/platform-server": "^6.1.0",
"@angular/animations": "^6.1.8",
"@angular/common": "^6.1.8",
"@angular/compiler": "^6.1.8",
"@angular/compiler-cli": "^6.1.8",
"@angular/core": "^6.1.8",
"@angular/http": "^6.1.8",
"@angular/platform-browser": "^6.1.8",
"@angular/platform-browser-dynamic": "^6.1.8",
"@angular/platform-server": "^6.1.8",
"@hapiness/core": "^1.5.4",
"@nguniversal/module-map-ngfactory-loader": "^6.0.0",
"@nguniversal/module-map-ngfactory-loader": "^6.1.0",
"@types/fs-extra": "^5.0.4",
"coveralls": "^3.0.2",
"fs-extra": "^7.0.0",
"istanbul": "^1.1.0-alpha.1",
"mocha": "^5.2.0",
"mocha-typescript": "^1.1.17",
"rimraf": "^2.6.2",
"rxjs": "^6.2.2",
"rxjs-compat": "^6.2.2",
"ts-node": "^7.0.0",
"rxjs": "^6.3.2",
"ts-node": "^7.0.1",
"tslint": "^5.11.0",
"typescript": "~2.9.2",
"unit.js": "^2.0.0",
"zone.js": "^0.8.26"
},
"peerDependencies": {
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/platform-server": "^6.1.0",
"@angular/compiler": "^6.1.8",
"@angular/core": "^6.1.8",
"@angular/platform-server": "^6.1.8",
"@hapiness/core": "^1.5.4",
"@hapiness/ng-universal-transfer-http": "^8.1.0",
"@nguniversal/module-map-ngfactory-loader": "^6.0.0",
"rxjs": "^6.2.2",
"rxjs-compat": "^6.2.2",
"ts-loader": "^4.4.2",
"webpack": "^4.16.2",
"webpack-cli": "^3.1.0"
"@hapiness/ng-universal-transfer-http": "^8.1.1",
"@nguniversal/module-map-ngfactory-loader": "^6.1.0",
"rxjs": "^6.3.2",
"ts-loader": "^5.2.0",
"webpack": "^4.19.1",
"webpack-cli": "^3.1.1"
},
"engines": {
"node": ">=7.0.0"
Expand Down

0 comments on commit c2f52ce

Please sign in to comment.