Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit cc6f717

Browse files
CaerusKarualan-agius4
authored andcommitted
fixup! docs: update issue template and Gotchas guide
1 parent 394f30f commit cc6f717

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.github/ISSUE_TEMPLATE/Bug.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<--
2-
**NOTE**: If you provide an incomplete template, the Universal team is liable to close your issue sight on scene.
3-
Please provide _as much detail as possible_ in as minimal a reproduction as possible. This means no third-party
2+
Please follow the below issue template. Issues not following the issue template will be closed.
3+
Please provide _as much detail as possible_ in as minimal a reproduction as possible. This means no/only one third-party
44
libraries, no application-specific code, etc. Essentially, we're looking for an `ng new` project with maybe one
55
additional file/change. If this is not possible, please look deeper into your issue or post it to StackOverflow
66
for support. This is a bug/feature tracker, meaning that something is actively _missing or broken_ in Angular Universal.

docs/gotchas.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ destroyed until the next render. Next, the server environment inherently does no
1111
same capabilities as the browser (and has some that likewise the browser does not). For
1212
instance, the server does not have any concept of cookies. You can polyfill this and other
1313
functionality, but there is no perfect solution for this. In later sections, we'll walk
14-
through potential mitigations to reduce the error plane when rendering on the server.
14+
through potential mitigations to reduce the scope of errors when rendering on the server.
1515

1616
Please also note the goal of SSR: improved initial render time for your application. This
1717
means that anything that has the potential to reduce the speed of your application in this
@@ -25,7 +25,7 @@ variables in the server environment. This is because the Universal project uses
2525
[domino](https://github.com/fgnass/domino) as the server DOM rendering engine. As a result,
2626
there is certain functionality that won't be present or supported on the server. This
2727
includes the `window` and `document` global objects, cookies, certain HTML elements (like canvas),
28-
and several others. There is no exhaustive list, so please be cognizant of the fact that if you
28+
and several others. There is no exhaustive list, so please be aware of the fact that if you
2929
see an error like this, where a previously-accessible global is not defined, it's likely because
3030
that global is not available through domino.
3131

@@ -76,8 +76,12 @@ often invocations of the global `window` element are to get window size, or some
7676
However, on the server, there is no concept of "screen", and so this functionality is rarely needed.
7777

7878
You may read online and elsewhere that the recommended approach is to use `isPlatformBrowser` or
79-
`isPlatformServer`. This guidance is **incorrect**. Instead, you should use Angular's Dependency Injection (DI)
80-
in order to remove the offending code and drop in a replacement at runtime. Here's an example:
79+
`isPlatformServer`. This guidance is **incorrect**. This is because you wind up creating platform-specific
80+
code branches in your application code. This not only increases the size of your application unnecessarily,
81+
but it also adds complexity that then has to be maintained. By separating code into separate platform-specific
82+
modules and implementations, your base code can remain about business logic, and platform-specific exceptions
83+
are handled as they should be: on a case-by-case abstraction basis. This can be accomplished using Angular's Dependency
84+
Injection (DI) in order to remove the offending code and drop in a replacement at runtime. Here's an example:
8185

8286
```ts
8387
// window-service.ts

0 commit comments

Comments
 (0)