2016-04-28 20:50:03 -04:00
|
|
|
{
|
|
|
|
"name": "@angular/platform-server",
|
2016-05-27 19:17:16 -04:00
|
|
|
"version": "0.0.0-PLACEHOLDER",
|
2016-09-14 19:44:39 -04:00
|
|
|
"description": "Angular - library for using Angular in Node.js",
|
2016-04-28 20:50:03 -04:00
|
|
|
"author": "angular",
|
|
|
|
"license": "MIT",
|
2021-04-12 15:13:05 -04:00
|
|
|
"engines": {
|
2021-04-26 14:47:32 -04:00
|
|
|
"node": "^12.14.1 || ^14.0.0"
|
2021-04-12 15:13:05 -04:00
|
|
|
},
|
2016-04-28 20:50:03 -04:00
|
|
|
"peerDependencies": {
|
2017-03-13 20:31:03 -04:00
|
|
|
"@angular/animations": "0.0.0-PLACEHOLDER",
|
2016-05-27 19:17:16 -04:00
|
|
|
"@angular/common": "0.0.0-PLACEHOLDER",
|
|
|
|
"@angular/compiler": "0.0.0-PLACEHOLDER",
|
2018-02-23 14:03:22 -05:00
|
|
|
"@angular/core": "0.0.0-PLACEHOLDER",
|
2017-08-16 12:00:03 -04:00
|
|
|
"@angular/platform-browser": "0.0.0-PLACEHOLDER",
|
2020-05-19 08:35:37 -04:00
|
|
|
"@angular/platform-browser-dynamic": "0.0.0-PLACEHOLDER"
|
2016-05-03 20:06:04 -04:00
|
|
|
},
|
|
|
|
"dependencies": {
|
2019-02-21 12:07:39 -05:00
|
|
|
"domino": "^2.1.2",
|
2021-03-16 15:10:32 -04:00
|
|
|
"tslib": "^2.1.0",
|
2020-04-01 07:35:30 -04:00
|
|
|
"xhr2": "^0.2.0"
|
2016-05-18 02:17:15 -04:00
|
|
|
},
|
|
|
|
"repository": {
|
|
|
|
"type": "git",
|
2018-12-07 06:12:59 -05:00
|
|
|
"url": "https://github.com/angular/angular.git",
|
|
|
|
"directory": "packages/platform-server"
|
2018-02-27 18:04:35 -05:00
|
|
|
},
|
|
|
|
"ng-update": {
|
|
|
|
"packageGroup": "NG_UPDATE_PACKAGE_GROUP"
|
2018-03-14 21:30:18 -04:00
|
|
|
},
|
feat(platform-server): allow shimming the global env sooner (#40559)
`@angular/platform-server` provides the foundation for rendering an
Angular app on the server. In order to achieve that, it uses a
server-side DOM implementation (currently [domino][1]).
For rendering on the server to work as closely as possible to running
the app on the browser, we need to make DOM globals (such as `Element`,
`HTMLElement`, etc.), which are normally provided by the browser,
available as globals on the server as well.
Currently, `@angular/platform-server` achieves this by extending the
`global` object with the DOM implementation provided by `domino`. This
assignment happens in the [setDomTypes()][2] function, which is
[called in a `PLATFORM_INITIALIZER`][3]. While this works in most cases,
there are some scenarios where the DOM globals are needed sooner (i.e.
before initializing the platform). See, for example, #24551 and #39950
for more details on such issues.
This commit provides a way to solve this problem by exposing a
side-effect-ful entry-point (`@angular/platform-server/init`), that
shims the `global` object with DOM globals. People will be able to
import this entry-point in their server-rendered apps before
bootstrapping the app (for example, in their `main.server.ts` file).
(See also [#39950 (comment)][4].)
In a future update, the [`universal` schematics][5] will include such an
import by default in newly generated projects.
[1]: https://www.npmjs.com/package/domino
[2]: https://github.com/angular/angular/blob/0fc8466f1be392917e0c/packages/platform-server/src/domino_adapter.ts#L17-L21
[3]: https://github.com/angular/angular/blob/0fc8466f1be392917e0c/packages/platform-server/src/server.ts#L33
[4]: https://github.com/angular/angular/issues/39950#issuecomment-747598403
[5]: https://github.com/angular/angular-cli/blob/cc51432661eb4ab4b6a3/packages/schematics/angular/universal
PR Close #40559
2021-02-11 12:24:52 -05:00
|
|
|
"sideEffects": [
|
|
|
|
"./bundles/platform-server-init.umd.js",
|
|
|
|
"./bundles/platform-server-init.umd.min.js",
|
|
|
|
"./esm2015/init/src/init.js",
|
|
|
|
"./fesm2015/init.js",
|
|
|
|
"./__ivy_ngcc__/bundles/platform-server-init.umd.js",
|
|
|
|
"./__ivy_ngcc__/esm2015/init/src/init.js",
|
|
|
|
"./__ivy_ngcc__/fesm2015/init.js"
|
|
|
|
],
|
2020-06-08 21:07:39 -04:00
|
|
|
"publishConfig":{
|
|
|
|
"registry":"https://wombat-dressing-room.appspot.com"
|
2018-04-12 02:10:28 -04:00
|
|
|
}
|
2016-04-28 20:50:03 -04:00
|
|
|
}
|