File tree Expand file tree Collapse file tree 5 files changed +9
-38
lines changed Expand file tree Collapse file tree 5 files changed +9
-38
lines changed Original file line number Diff line number Diff line change 35
35
// Note: We can remove this once we fully switched away from Gulp. Currently we still set
36
36
// some options here just in favor of the standard tsconfig's which extending this one.
37
37
"suppressTsconfigOverrideWarnings" : true ,
38
-
39
- // Enable tsickle so that decorators are processed by tsickle. This is necessary because
40
- // we don't want to ship JavaScript files that contain references to DOM elements. This
41
- // breaks server-side rendering for non-CLI projects: see: angular#30586.
42
- "tsickle" : true ,
43
-
44
38
// See https://github.com/angular/angular/issues/29107
45
39
"devmodeTargetOverride" : " es5"
46
40
}
Original file line number Diff line number Diff line change 9
9
},
10
10
"bazelOptions" : {
11
11
"suppressTsconfigOverrideWarnings" : true ,
12
-
13
- // Disable tsickle. Tsickle is only needed for building library code that will be
14
- // shipped through npm packages. This should speed up compilation for tests.
15
- "tsickle" : false ,
16
-
17
12
// See https://github.com/angular/angular/issues/29107
18
13
"devmodeTargetOverride" : " es5"
19
14
}
Original file line number Diff line number Diff line change 1
1
import 'reflect-metadata' ;
2
2
import 'zone.js' ;
3
3
4
+ // We need to mock a few native DOM globals as those are not present on the server, but they
5
+ // are required for decorator metadata. The View Engine compiler preserves Angular decorator
6
+ // metadata in the JS output. This could mean for example that inputs which are typed to
7
+ // `HTMLElement` break on the server, as the `__decorate` call requires the `HTMLElement`
8
+ // global to be present. More details: https://github.com/angular/angular/issues/30586.
9
+ ( global as any ) . HTMLElement = { } ;
10
+ ( global as any ) . Event = { } ;
11
+ ( global as any ) . TransitionEvent = { } ;
12
+
4
13
import { renderModuleFactory } from '@angular/platform-server' ;
5
14
import { readFileSync , writeFileSync } from 'fs' ;
6
15
import { join } from 'path' ;
Original file line number Diff line number Diff line change @@ -7,19 +7,6 @@ exports_files([
7
7
"system-rxjs-operators.js" ,
8
8
])
9
9
10
- # Custom "tsc_wrapped" binary that has "tsickle" available as runtime dependency.
11
- # This is needed as the default compiler for a "ts_library" does not have a dependency
12
- # on "tsickle" by default.
13
- nodejs_binary (
14
- name = "tsc_wrapped_with_tsickle" ,
15
- data = [
16
- "@npm//@bazel/typescript" ,
17
- "@npm//tsickle" ,
18
- ],
19
- entry_point = "@npm//:node_modules/@bazel/typescript/internal/tsc_wrapped/tsc_wrapped.js" ,
20
- install_source_map_support = False ,
21
- )
22
-
23
10
# Workaround for https://github.com/bazelbuild/bazel-toolchains/issues/356. We need the
24
11
# "SYS_ADMIN" capability in order to run browsers with sandbox enabled.
25
12
platform (
Original file line number Diff line number Diff line change @@ -29,20 +29,6 @@ shelljs.cd(projectDir);
29
29
// Workaround for https://github.com/angular/angular/issues/18810.
30
30
shelljs . exec ( 'ngc -p angular-tsconfig.json' ) ;
31
31
32
- // Workaround for https://github.com/angular/angular/issues/30586. It's not possible to
33
- // enable tsickle decorator processing without enabling import rewriting to closure.
34
- // This replacement allows us to enable decorator processing without rewriting imports.
35
- searchAndReplace (
36
- / ( t h i s \. t r a n s f o r m T y p e s T o C l o s u r e ) = b a z e l O p t s \. t s i c k l e ; / , '$1 = false;' ,
37
- 'node_modules/@bazel/typescript/internal/tsc_wrapped/compiler_host.js' ) ;
38
-
39
- // Workaround for https://github.com/angular/angular/issues/32389. We need to ensure
40
- // that tsickle is available for esm5 output re-compilations.
41
- searchAndReplace (
42
- '@npm//@bazel/typescript/bin:tsc_wrapped' ,
43
- '@angular_material//tools:tsc_wrapped_with_tsickle' ,
44
- 'node_modules/@angular/bazel/src/esm5.bzl' ) ;
45
-
46
32
// Workaround for: https://github.com/angular/angular/issues/32651. We just do not
47
33
// generate re-exports for secondary entry-points. Similar to what "ng-packagr" does.
48
34
searchAndReplace (
You can’t perform that action at this time.
0 commit comments