Skip to content

Commit

Permalink
this is a test
Browse files Browse the repository at this point in the history
  • Loading branch information
JeanMeche committed Apr 5, 2024
1 parent a84cb62 commit 755265f
Show file tree
Hide file tree
Showing 12 changed files with 870 additions and 253 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.18.2
20.11.1
16 changes: 8 additions & 8 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -64,16 +64,16 @@ load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
name = "nodejs",
node_repositories = {
"18.18.2-darwin_arm64": ("node-v18.18.2-darwin-arm64.tar.gz", "node-v18.18.2-darwin-arm64", "9f982cc91b28778dd8638e4f94563b0c2a1da7aba62beb72bd427721035ab553"),
"18.18.2-darwin_amd64": ("node-v18.18.2-darwin-x64.tar.gz", "node-v18.18.2-darwin-x64", "5bb8da908ed590e256a69bf2862238c8a67bc4600119f2f7721ca18a7c810c0f"),
"18.18.2-linux_arm64": ("node-v18.18.2-linux-arm64.tar.xz", "node-v18.18.2-linux-arm64", "2e630e18548627f61eaf573233da7949dc0a1df5eef3f486fa9820c5f6c121aa"),
"18.18.2-linux_ppc64le": ("node-v18.18.2-linux-ppc64le.tar.xz", "node-v18.18.2-linux-ppc64le", "b0adff5cf5938266b711d6c724fb134d802e0dee40b3a3f73d162de1b3d11880"),
"18.18.2-linux_s390x": ("node-v18.18.2-linux-s390x.tar.xz", "node-v18.18.2-linux-s390x", "c70ec2074b5e2b42c55bb4b8105418b67bf8a61c500d9376a07430dfcc341fdb"),
"18.18.2-linux_amd64": ("node-v18.18.2-linux-x64.tar.xz", "node-v18.18.2-linux-x64", "75aba25ae76999309fc6c598efe56ce53fbfc221381a44a840864276264ab8ac"),
"18.18.2-windows_amd64": ("node-v18.18.2-win-x64.zip", "node-v18.18.2-win-x64", "3bb0e51e579a41a22b3bf6cb2f3e79c03801aa17acbe0ca00fc555d1282e7acd"),
"20.11.1-darwin_arm64": ("node-v20.11.1-darwin-arm64.tar.gz", "node-v20.11.1-darwin-arm64", "e0065c61f340e85106a99c4b54746c5cee09d59b08c5712f67f99e92aa44995d"),
"20.11.1-darwin_amd64": ("node-v20.11.1-darwin-x64.tar.gz", "node-v20.11.1-darwin-x64", "c52e7fb0709dbe63a4cbe08ac8af3479188692937a7bd8e776e0eedfa33bb848"),
"20.11.1-linux_arm64": ("node-v20.11.1-linux-arm64.tar.xz", "node-v20.11.1-linux-arm64", "c957f29eb4e341903520caf362534f0acd1db7be79c502ae8e283994eed07fe1"),
"20.11.1-linux_ppc64le": ("node-v20.11.1-linux-ppc64le.tar.xz", "node-v20.11.1-linux-ppc64le", "51343cacf5cdf5c4b5e93e919d19dd373d6ef43d5f2c666eae299f26e31d08b5"),
"20.11.1-linux_s390x": ("node-v20.11.1-linux-s390x.tar.xz", "node-v20.11.1-linux-s390x", "b32616b705cd0ddbb230b95c693e3d7a37becc2ced9bcadea8dc824cceed6be0"),
"20.11.1-linux_amd64": ("node-v20.11.1-linux-x64.tar.xz", "node-v20.11.1-linux-x64", "d8dab549b09672b03356aa2257699f3de3b58c96e74eb26a8b495fbdc9cf6fbe"),
"20.11.1-windows_amd64": ("node-v20.11.1-win-x64.zip", "node-v20.11.1-win-x64", "bc032628d77d206ffa7f133518a6225a9c5d6d9210ead30d67e294ff37044bda"),
},
# We need at least Node 18.17 due to some transitive dependencies.
node_version = "18.18.2",
node_version = "20.11.1",
)

# Download npm dependencies.
Expand Down
11 changes: 9 additions & 2 deletions adev/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,14 @@
"externalDependencies": [
"path"
],
"define": {
"self": "this"
},
"outputPath": "dist/angular-dev",
"index": "src/index.html",
"browser": "src/main.ts",
"server": "src/main.server.ts",
"polyfills": ["src/polyfills.ts", "zone.js"],
"polyfills": [],
"tsConfig": "tsconfig.app.json",
"inlineStyleLanguage": "scss",
"assets": [
Expand All @@ -46,7 +49,11 @@
},
"configurations": {
"production": {
"outputHashing": "all"
"outputHashing": "all",
"sourceMap": {
"vendor": true,
"scripts": true
}
},
"development": {
"optimization": false,
Expand Down
3 changes: 2 additions & 1 deletion adev/src/app/app.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
ErrorHandler,
inject,
provideZoneChangeDetection,
ɵprovideZonelessChangeDetection,
} from '@angular/core';
import {
DOCS_CONTENT_LOADER,
Expand Down Expand Up @@ -68,6 +69,7 @@ export const appConfig: ApplicationConfig = {
},
}),
),
ɵprovideZonelessChangeDetection(),
provideClientHydration(),
provideHttpClient(withFetch()),
provideAnimationsAsync(),
Expand All @@ -91,7 +93,6 @@ export const appConfig: ApplicationConfig = {
deps: [DOCUMENT],
},
{provide: TitleStrategy, useClass: ADevTitleStrategy},
provideZoneChangeDetection({eventCoalescing: true}),
ReferenceScrollHandler,
],
};
9 changes: 0 additions & 9 deletions adev/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,3 @@
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.dev/license
*/

(globalThis as Record<string, unknown>)['__zone_symbol__UNPATCHED_EVENTS'] = [
'mousemove',
'mouseenter',
'mouseleave',
'resize',
'message', // filter post message events from iframes
'scroll',
];
25 changes: 15 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"/ ": "",
"postinstall": "node --preserve-symlinks --preserve-symlinks-main ./tools/postinstall-patches.js && patch-package --patch-dir tools/esm-interop/patches/npm && patch-package --patch-dir tools/npm-patches",
"prepare": "husky",
"ng-dev": "ts-node --esm --project .ng-dev/tsconfig.json --transpile-only node_modules/@angular/ng-dev/bundles/cli.mjs",
"build": "ts-node --esm --project scripts/tsconfig.json scripts/build/build-packages-dist.mts",
"ng-dev": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only node_modules/@angular/ng-dev/bundles/cli.mjs",
"build": "node --no-warnings=ExperimentalWarning --loader ts-node/esm/transpile-only scripts/build/build-packages-dist.mts",
"test": "bazelisk test",
"test:ci": "bazelisk test -- //... -//integration/... -//adev/... -//devtools/... -//aio/...",
"test-tsec": "bazelisk test //... --build_tag_filters=tsec --test_tag_filters=tsec",
Expand All @@ -49,12 +49,12 @@
},
"// 1": "dependencies are used locally and by bazel",
"dependencies": {
"@angular-devkit/build-angular": "17.3.0-rc.0",
"@angular-devkit/core": "17.3.0-rc.0",
"@angular-devkit/schematics": "17.3.0-rc.0",
"@angular/cdk": "17.3.0-rc.0",
"@angular/cli": "17.3.0-rc.0",
"@angular/material": "17.3.0-rc.0",
"@angular-devkit/build-angular": "18.0.0-next.1",
"@angular-devkit/core": "18.0.0-next.1",
"@angular-devkit/schematics": "18.0.0-next.1",
"@angular/cdk": "18.0.0-next.2",
"@angular/cli": "18.0.0-next.1",
"@angular/material": "18.0.0-next.2",
"@babel/cli": "7.24.1",
"@babel/core": "7.24.3",
"@babel/generator": "7.24.1",
Expand Down Expand Up @@ -151,7 +151,6 @@
"devDependencies": {
"@actions/core": "^1.10.0",
"@angular-devkit/architect-cli": "^0.1703.0-rc",
"@angular/animations": "^17.3.0-rc",
"@angular/build-tooling": "https://github.com/angular/dev-infra-private-build-tooling-builds.git#4a72a4dd4c19416cb8204deee884500766fee9f8",
"@angular/docs": "https://github.com/angular/dev-infra-private-docs-builds.git#82c4573f5c9d4fb864271a1c74259fc251457e2f",
"@angular/ng-dev": "https://github.com/angular/dev-infra-private-ng-dev-builds.git#36946be4df61f6549ae3829c026022e47674eae2",
Expand Down Expand Up @@ -225,6 +224,12 @@
"// 4": "Ensure that a single instance of the `saucelabs` package is used. Protractor and the Karma sauce launcher pull this package as dependency. A single instance allows for e.g. easier patching in the Karma config.",
"resolutions": {
"**/https-proxy-agent": "7.0.4",
"**/saucelabs": "7.5.0"
"**/saucelabs": "7.5.0",
"**/@angular/core": "18.0.0-next.3",
"**/@angular/forms": "18.0.0-next.3",
"**/@angular/common": "18.0.0-next.3",
"**/@angular/animations": "18.0.0-next.3",
"**/@angular/material": "18.0.0-next.2",
"**/@angular/cdk": "18.0.0-next.2"
}
}
6 changes: 6 additions & 0 deletions packages/platform-server/init/test/shims_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,18 @@ import domino from '../src/bundled-domino';
import {applyShims} from '../src/shims';

describe('applyShims()', () => {
// Globals that only have getters so they have to be skipped in tests.
const readonlyGlobals = new Set(['crypto']);
const globalClone = {...global};

afterEach(() => {
// Un-patch `global`.
const currentProps = Object.keys(global);
for (const prop of currentProps) {
if (readonlyGlobals.has(prop)) {
continue;
}

if (globalClone.hasOwnProperty(prop)) {
(global as any)[prop] = (globalClone as any)[prop];
} else {
Expand Down
15 changes: 15 additions & 0 deletions tools/npm-patches/@angular+core+18.0.0-next.2.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/node_modules/@angular/core/fesm2022/core.mjs b/node_modules/@angular/core/fesm2022/core.mjs
index 848d886..8d1f803 100755
--- a/node_modules/@angular/core/fesm2022/core.mjs
+++ b/node_modules/@angular/core/fesm2022/core.mjs
@@ -36448,7 +36448,9 @@ function withDomHydration() {
// Note: the cleanup task *MUST* be scheduled within the Angular zone
// to ensure that change detection is properly run afterward.
whenStableWithTimeout(appRef, injector).then(() => {
- NgZone.assertInAngularZone();
+ if (typeof Zone !== 'undefined') {
+ NgZone.assertInAngularZone();
+ }
cleanupDehydratedViews(appRef);
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
printHydrationStats(injector);
4 changes: 3 additions & 1 deletion tools/tslint/tsNodeLoaderRule.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ const Lint = require('tslint');

// Custom rule that registers all of the custom rules, written in TypeScript, with ts-node.
// This is necessary, because `tslint` and IDEs won't execute any rules that aren't in a .js file.
require('ts-node').register();
require('ts-node').register({
project: path.join(__dirname, '../../tsconfig-tslint.json'),
});

// Add a noop rule so tslint doesn't complain.
exports.Rule = class Rule extends Lint.Rules.AbstractRule {
Expand Down
3 changes: 2 additions & 1 deletion tsconfig-tslint.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"allowJs": true
"allowJs": true,
"esModuleInterop": true
},
"include": [
"packages/**/*",
Expand Down
9 changes: 9 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
// This tsconfig is required for our scripts that use `ts-node`.
// Due to https://github.com/TypeStrong/ts-node/issues/2094 we can't pass the parameters
// through the command line in Node 20+ so we have to do it through the tsconfig.
"extends": "./packages/tsconfig.json",
"ts-node": {
"transpileOnly": true
}
}

0 comments on commit 755265f

Please sign in to comment.