Skip to content

Commit

Permalink
feat: update to Angular 19 (#200)
Browse files Browse the repository at this point in the history
Changes that were applied:

- bump dependency versions
- applied migrations from `migrations.json`
- remove unused component imports
- add `as unknown` to `updateOptions` to fix a previously working
  type conversion
- add `skipToken` check to `normalizeOptions` to narrow down typing
luii authored Dec 17, 2024
1 parent b0d39bb commit f6f79a1
Showing 24 changed files with 12,227 additions and 11,773 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -24,7 +24,8 @@
"prefix": "query",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -39,4 +39,5 @@ testem.log
Thumbs.db

.nx/cache
.nx/workspace-data
.angular
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -4,3 +4,5 @@
/coverage
.angular
.nx

/.nx/workspace-data
3 changes: 2 additions & 1 deletion devtools/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -24,7 +24,8 @@
"prefix": "query",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
6 changes: 3 additions & 3 deletions devtools/package.json
Original file line number Diff line number Diff line change
@@ -10,11 +10,11 @@
"url": "https://github.com/sponsors/ngneat"
},
"peerDependencies": {
"@angular/core": ">=16.0.0 <19.0.0",
"@tanstack/query-devtools": "5.4.2"
"@angular/core": ">=16.0.0 <=19.0.4",
"@tanstack/query-devtools": "5.61.4"
},
"dependencies": {
"tslib": "^2.3.0"
"tslib": "^2.4.0"
},
"publishConfig": {
"access": "public"
8 changes: 4 additions & 4 deletions jest.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { getJestProjects } from '@nx/jest';
import { getJestProjectsAsync } from '@nx/jest';

export default {
projects: getJestProjects(),
};
export default async () => ({
projects: await getJestProjectsAsync(),
});
223 changes: 175 additions & 48 deletions migrations.json
Original file line number Diff line number Diff line change
@@ -1,82 +1,209 @@
{
"migrations": [
{
"version": "18.1.0-beta.3",
"description": "Moves affected.defaultBase to defaultBase in `nx.json`",
"implementation": "./src/migrations/update-17-2-0/move-default-base",
"cli": "nx",
"version": "19.2.0-beta.2",
"description": "Updates the default workspace data directory to .nx/workspace-data",
"implementation": "./src/migrations/update-19-2-0/move-workspace-data-directory",
"package": "nx",
"name": "19-2-0-move-graph-cache-directory"
},
{
"cli": "nx",
"version": "19.2.2-beta.0",
"description": "Updates the nx wrapper.",
"implementation": "./src/migrations/update-17-3-0/update-nxw",
"package": "nx",
"name": "19-2-2-update-nx-wrapper"
},
{
"version": "19.2.4-beta.0",
"description": "Set project name in nx.json explicitly",
"implementation": "./src/migrations/update-19-2-4/set-project-name",
"x-repair-skip": true,
"package": "nx",
"name": "move-default-base-to-nx-json-root"
"name": "19-2-4-set-project-name"
},
{
"version": "20.0.0-beta.7",
"description": "Migration for v20.0.0-beta.7",
"implementation": "./src/migrations/update-20-0-0/move-use-daemon-process",
"package": "nx",
"name": "move-use-daemon-process"
},
{
"version": "20.0.1",
"description": "Set `useLegacyCache` to true for migrating workspaces",
"implementation": "./src/migrations/update-20-0-1/use-legacy-cache",
"x-repair-skip": true,
"package": "nx",
"name": "use-legacy-cache"
},
{
"version": "20.2.0-beta.5",
"description": "Update TypeScript ESLint packages to v8.13.0 if they are already on v8",
"implementation": "./src/migrations/update-20-2-0/update-typescript-eslint-v8-13-0",
"package": "@nx/eslint",
"name": "update-typescript-eslint-v8.13.0"
},
{
"cli": "nx",
"version": "19.1.0-beta.6",
"description": "Migrate no-extra-semi rules into user config, out of nx extendable configs",
"implementation": "./src/migrations/update-19-1-0-migrate-no-extra-semi/migrate-no-extra-semi",
"package": "@nx/eslint-plugin",
"name": "update-19-1-0-rename-no-extra-semi"
"version": "20.0.0-beta.5",
"description": "replace getJestProjects with getJestProjectsAsync",
"implementation": "./src/migrations/update-20-0-0/replace-getJestProjects-with-getJestProjectsAsync",
"package": "@nx/jest",
"name": "replace-getJestProjects-with-getJestProjectsAsync"
},
{
"cli": "nx",
"version": "18.1.0-beta.1",
"requires": {
"@angular/core": ">=17.2.0"
},
"description": "Update the @angular/cli package version to ~17.2.0.",
"factory": "./src/migrations/update-18-1-0/update-angular-cli",
"version": "19.6.0-beta.0",
"description": "Use serve-static or preview for webServerCommand.",
"implementation": "./src/migrations/update-19-6-0/use-serve-static-preview-for-command",
"package": "@nx/playwright",
"name": "19-6-0-use-serve-static-preview-for-command"
},
{
"cli": "nx",
"version": "19.6.0-beta.1",
"description": "Add inferred ciTargetNames to targetDefaults with dependsOn to ensure dependent application builds are scheduled before atomized tasks.",
"implementation": "./src/migrations/update-19-6-0/add-e2e-ci-target-defaults",
"package": "@nx/playwright",
"name": "update-19-6-0-add-e2e-ci-target-defaults"
},
{
"cli": "nx",
"version": "19.2.1-beta.0",
"requires": { "@angular-eslint/eslint-plugin": ">=18.0.0" },
"description": "Installs the '@typescript-eslint/utils' package when having installed '@angular-eslint/eslint-plugin' or '@angular-eslint/eslint-plugin-template' with version >=18.0.0.",
"factory": "./src/migrations/update-19-2-1/add-typescript-eslint-utils",
"package": "@nx/angular",
"name": "update-angular-cli-version-17-2-0"
"name": "add-typescript-eslint-utils"
},
{
"cli": "nx",
"version": "18.1.1-beta.0",
"description": "Ensure targetDefaults inputs for task hashing when '@nx/angular:webpack-browser' is used are correct for Module Federation.",
"factory": "./src/migrations/update-18-1-1/fix-target-defaults-inputs",
"version": "19.5.0-beta.1",
"requires": { "@angular/core": ">=18.1.0" },
"description": "Update the @angular/cli package version to ~18.1.0.",
"factory": "./src/migrations/update-19-5-0/update-angular-cli",
"package": "@nx/angular",
"name": "fix-target-defaults-for-webpack-browser"
"name": "update-angular-cli-version-18-1-0"
},
{
"cli": "nx",
"version": "18.2.0-beta.0",
"requires": {
"@angular/core": ">=17.3.0"
},
"description": "Update the @angular/cli package version to ~17.3.0.",
"factory": "./src/migrations/update-18-2-0/update-angular-cli",
"version": "19.6.0-beta.4",
"description": "Ensure Module Federation DTS is turned off by default.",
"factory": "./src/migrations/update-19-6-0/turn-off-dts-by-default",
"package": "@nx/angular",
"name": "update-angular-cli-version-17-3-0"
"name": "update-19-6-0"
},
{
"cli": "nx",
"version": "19.1.0-beta.2",
"requires": {
"@angular/core": ">=18.0.0"
},
"description": "Update the @angular/cli package version to ~18.0.0.",
"factory": "./src/migrations/update-19-1-0/update-angular-cli",
"version": "19.6.0-beta.7",
"requires": { "@angular/core": ">=18.2.0" },
"description": "Update the @angular/cli package version to ~18.2.0.",
"factory": "./src/migrations/update-19-6-0/update-angular-cli",
"package": "@nx/angular",
"name": "update-angular-cli-version-18-0-0"
"name": "update-angular-cli-version-18-2-0"
},
{
"cli": "nx",
"version": "18.1.0-beta.3",
"description": "Remove invalid baseUrl option from @nx/playwright:playwright targets in project.json.",
"implementation": "./src/migrations/update-18-1-0/remove-baseUrl-from-project-json",
"package": "@nx/playwright",
"name": "18-1-0-remove-baseUrl-from-project-json"
"version": "19.6.1-beta.0",
"description": "Ensure Target Defaults are set correctly for Module Federation.",
"factory": "./src/migrations/update-19-6-1/ensure-depends-on-for-mf",
"package": "@nx/angular",
"name": "update-19-6-1-ensure-module-federation-target-defaults"
},
{
"cli": "nx",
"version": "20.2.0-beta.2",
"description": "Update the ModuleFederationConfig import use @nx/module-federation.",
"factory": "./src/migrations/update-20-2-0/migrate-mf-imports-to-new-package",
"package": "@nx/angular",
"name": "update-20-2-0-update-module-federation-config-import"
},
{
"cli": "nx",
"version": "20.2.0-beta.2",
"description": "Update the withModuleFederation import use @nx/module-federation/angular.",
"factory": "./src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package",
"package": "@nx/angular",
"name": "update-20-2-0-update-with-module-federation-import"
},
{
"cli": "nx",
"version": "20.2.0-beta.5",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Update the @angular/cli package version to ~19.0.0.",
"factory": "./src/migrations/update-20-2-0/update-angular-cli",
"package": "@nx/angular",
"name": "update-angular-cli-version-19-0-0"
},
{
"cli": "nx",
"version": "20.2.0-beta.5",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Add the '@angular/localize/init' polyfill to the 'polyfills' option of targets using esbuild-based executors.",
"factory": "./src/migrations/update-20-2-0/add-localize-polyfill-to-targets",
"package": "@nx/angular",
"name": "add-localize-polyfill-to-targets"
},
{
"cli": "nx",
"version": "20.2.0-beta.5",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Update '@angular/ssr' import paths to use the new '/node' entry point when 'CommonEngine' is detected.",
"factory": "./src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point",
"package": "@nx/angular",
"name": "update-angular-ssr-imports-to-use-node-entry-point"
},
{
"cli": "nx",
"version": "20.2.0-beta.6",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Disable the Angular ESLint prefer-standalone rule if not set.",
"factory": "./src/migrations/update-20-2-0/disable-angular-eslint-prefer-standalone",
"package": "@nx/angular",
"name": "disable-angular-eslint-prefer-standalone"
},
{
"cli": "nx",
"version": "20.2.0-beta.8",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Remove Angular ESLint rules that were removed in v19.0.0.",
"factory": "./src/migrations/update-20-2-0/remove-angular-eslint-rules",
"package": "@nx/angular",
"name": "remove-angular-eslint-rules"
},
{
"cli": "nx",
"version": "20.2.0-beta.8",
"requires": { "@angular/core": ">=19.0.0" },
"description": "Remove the deprecated 'tailwindConfig' option from ng-packagr executors. Tailwind CSS configurations located at the project or workspace root will be picked up automatically.",
"factory": "./src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors",
"package": "@nx/angular",
"name": "remove-tailwind-config-from-ng-packagr-executors"
},
{
"version": "19.0.0",
"description": "Updates non-standalone Directives, Component and Pipes to 'standalone:false' and removes 'standalone:true' from those who are standalone",
"factory": "./bundles/explicit-standalone-flag#migrate",
"package": "@angular/core",
"name": "explicit-standalone-flag"
},
{
"version": "18.0.0",
"description": "Updates two-way bindings that have an invalid expression to use the longform expression instead.",
"factory": "./migrations/invalid-two-way-bindings/bundle",
"version": "19.0.0",
"description": "Updates ExperimentalPendingTasks to PendingTasks",
"factory": "./bundles/pending-tasks#migrate",
"package": "@angular/core",
"name": "invalid-two-way-bindings"
"name": "pending-tasks"
},
{
"version": "18.0.0",
"description": "Replace deprecated HTTP related modules with provider functions",
"factory": "./migrations/http-providers/bundle",
"version": "19.0.0",
"description": "Replaces `APP_INITIALIZER`, `ENVIRONMENT_INITIALIZER` & `PLATFORM_INITIALIZER` respectively with `provideAppInitializer`, `provideEnvironmentInitializer` & `providePlatformInitializer`.",
"factory": "./bundles/provide-initializer#migrate",
"optional": true,
"package": "@angular/core",
"name": "migration-http-providers"
"name": "provide-initializer"
}
]
}
}
3 changes: 2 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
@@ -62,5 +62,6 @@
"style": "scss"
}
},
"defaultProject": "query-playground"
"defaultProject": "query-playground",
"useLegacyCache": true
}
23,533 changes: 11,930 additions & 11,603 deletions package-lock.json

Large diffs are not rendered by default.

87 changes: 44 additions & 43 deletions package.json
Original file line number Diff line number Diff line change
@@ -19,52 +19,53 @@
},
"private": true,
"dependencies": {
"@angular/animations": "18.0.1",
"@angular/common": "18.0.1",
"@angular/compiler": "18.0.1",
"@angular/core": "18.0.1",
"@angular/forms": "18.0.1",
"@angular/platform-browser": "18.0.1",
"@angular/platform-browser-dynamic": "18.0.1",
"@angular/router": "18.0.1",
"@angular/animations": "~19.0.4",
"@angular/common": "~19.0.4",
"@angular/compiler": "~19.0.4",
"@angular/core": "~19.0.4",
"@angular/forms": "~19.0.4",
"@angular/platform-browser": "~19.0.4",
"@angular/platform-browser-dynamic": "~19.0.4",
"@angular/router": "~19.0.4",
"@ngneat/until-destroy": "^10.0.0",
"@nx/angular": "19.1.1",
"@tanstack/query-core": "^5.17.1",
"@nx/angular": "~20.2.2",
"@tanstack/query-core": "^5.62.7",
"bulma": "^0.9.4",
"ngxtension": "^2.0.0",
"ngxtension": "^4.2.0",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "0.14.4"
"tslib": "^2.4.0",
"zone.js": "0.15.0"
},
"devDependencies": {
"@angular-devkit/build-angular": "18.0.2",
"@angular-devkit/core": "18.0.2",
"@angular-devkit/schematics": "18.0.2",
"@angular-eslint/eslint-plugin": "17.3.0",
"@angular-eslint/eslint-plugin-template": "17.3.0",
"@angular-eslint/template-parser": "17.3.0",
"@angular/cli": "~18.0.0",
"@angular/compiler-cli": "18.0.1",
"@angular/language-service": "18.0.1",
"@angular-devkit/build-angular": "19.0.5",
"@angular-devkit/core": "19.0.5",
"@angular-devkit/schematics": "19.0.5",
"@angular-eslint/eslint-plugin": "19.0.2",
"@angular-eslint/eslint-plugin-template": "19.0.2",
"@angular-eslint/template-parser": "19.0.2",
"@angular/cli": "~19.0.0",
"@angular/compiler-cli": "19.0.4",
"@angular/language-service": "19.0.4",
"@commitlint/cli": "19.3.0",
"@commitlint/config-angular": "19.3.0",
"@commitlint/config-conventional": "19.2.2",
"@jscutlery/semver": "5.2.2",
"@nx/devkit": "19.1.1",
"@nx/eslint": "19.1.1",
"@nx/eslint-plugin": "19.1.1",
"@nx/jest": "19.1.1",
"@nx/js": "19.1.1",
"@nx/playwright": "19.1.1",
"@nx/workspace": "19.1.1",
"@jscutlery/semver": "^5.5.1",
"@nx/devkit": "20.2.2",
"@nx/eslint": "20.2.2",
"@nx/eslint-plugin": "20.2.2",
"@nx/jest": "20.2.2",
"@nx/js": "20.2.2",
"@nx/playwright": "20.2.2",
"@nx/workspace": "20.2.2",
"@playwright/test": "^1.36.0",
"@schematics/angular": "18.0.2",
"@swc-node/register": "1.8.0",
"@swc/core": "~1.3.85",
"@types/jest": "^29.4.0",
"@schematics/angular": "19.0.5",
"@swc-node/register": "1.9.2",
"@swc/core": "1.5.7",
"@types/jest": "29.5.14",
"@types/node": "^18.16.9",
"@typescript-eslint/eslint-plugin": "7.9.0",
"@typescript-eslint/parser": "7.9.0",
"@typescript-eslint/eslint-plugin": "7.16.0",
"@typescript-eslint/parser": "7.16.0",
"@typescript-eslint/utils": "^7.16.0",
"autoprefixer": "^10.4.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
@@ -74,24 +75,24 @@
"expect-type": "^0.17.3",
"git-cz": "^4.9.0",
"husky": "^8.0.3",
"jest": "^29.4.1",
"jest-environment-jsdom": "^29.4.1",
"jest-preset-angular": "14.1.0",
"jest": "29.7.0",
"jest-environment-jsdom": "29.7.0",
"jest-preset-angular": "14.4.2",
"jsonc-eslint-parser": "^2.1.0",
"ng-packagr": "18.0.0",
"nx": "19.1.1",
"ng-packagr": "19.0.1",
"nx": "20.2.2",
"postcss": "^8.4.5",
"postcss-import": "~14.1.0",
"postcss-preset-env": "~7.5.0",
"postcss-url": "~10.1.3",
"prettier": "3.1.0",
"ts-jest": "^29.1.0",
"ts-node": "10.9.1",
"typescript": "5.4.5"
"typescript": "5.6.3"
},
"overrides": {
"@jscutlery/semver": {
"@nx/devkit": "19.1.1"
"@nx/devkit": "20.2.2"
}
},
"workspaces": [
3 changes: 2 additions & 1 deletion query/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -25,7 +25,8 @@
"prefix": "query",
"style": "kebab-case"
}
]
],
"@angular-eslint/prefer-standalone": "off"
}
},
{
6 changes: 3 additions & 3 deletions query/package.json
Original file line number Diff line number Diff line change
@@ -10,11 +10,11 @@
"url": "https://github.com/sponsors/ngneat"
},
"peerDependencies": {
"@tanstack/query-core": "^5.4.3",
"@angular/core": ">=16.0.0 <19.0.0"
"@tanstack/query-core": "^5.62.7",
"@angular/core": ">=16.0.0 <=19.0.4"
},
"dependencies": {
"tslib": "^2.3.0"
"tslib": "^2.4.0"
},
"publishConfig": {
"access": "public"
2 changes: 1 addition & 1 deletion query/src/lib/base-query.ts
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ export function createBaseQuery<
...newOptions,
},
injector,
) as QueryObserverOptions<
) as unknown as QueryObserverOptions<
TQueryFnData,
TError,
TData,
20 changes: 11 additions & 9 deletions query/src/lib/query-options.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import { Injector, runInInjectionContext } from '@angular/core';
import type {
DataTag,
DefaultError,
DefaultedQueryObserverOptions,
QueryClient,
QueryFunctionContext,
QueryKey,
QueryObserverOptions,
import {
skipToken,
type DataTag,
type DefaultError,
type DefaultedQueryObserverOptions,
type QueryClient,
type QueryFunctionContext,
type QueryKey,
type QueryObserverOptions,
} from '@tanstack/query-core';
import { isObservable } from 'rxjs';
import { CreateBaseQueryOptions } from './base-query';
@@ -122,7 +123,8 @@ export function normalizeOptions<

const originalQueryFn = defaultedOptions.queryFn;

if (originalQueryFn) {
// once the skipToken is encountered we just return the default options instead
if (originalQueryFn && originalQueryFn !== skipToken) {
defaultedOptions.queryFn = function (ctx: QueryFunctionContext) {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const _this = this;
9 changes: 4 additions & 5 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -2,10 +2,9 @@ import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';

@Component({
standalone: true,
imports: [RouterModule],
selector: 'query-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
imports: [RouterModule],
selector: 'query-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {}
9 changes: 4 additions & 5 deletions src/app/basic-page/todos-page.component.ts
Original file line number Diff line number Diff line change
@@ -10,11 +10,10 @@ import { TabsComponent } from '../ui/query-tabs/tabs.component';
import { TabComponent } from '../ui/query-tab/tab.component';

@Component({
selector: 'query-todos-page',
standalone: true,
imports: [CommonModule, TabsComponent, TabComponent],
templateUrl: './todos-page.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'query-todos-page',
imports: [CommonModule, TabsComponent, TabComponent],
templateUrl: './todos-page.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class TodosPageComponent {
#todosService = inject(TodosService);
9 changes: 4 additions & 5 deletions src/app/dynamic-page/dynamic-page.component.ts
Original file line number Diff line number Diff line change
@@ -5,11 +5,10 @@ import { computedAsync } from 'ngxtension/computed-async';
import { createPendingObserverResult } from '@ngneat/query';

@Component({
selector: 'query-dynamic-page',
standalone: true,
imports: [RouterModule],
templateUrl: './dynamic-page.component.html',
styleUrls: ['./dynamic-page.component.scss'],
selector: 'query-dynamic-page',
imports: [RouterModule],
templateUrl: './dynamic-page.component.html',
styleUrls: ['./dynamic-page.component.scss']
})
export class DynamicPageComponent {
id = input.required<string>();
11 changes: 5 additions & 6 deletions src/app/infinite-scroll-page/posts-page.component.ts
Original file line number Diff line number Diff line change
@@ -4,12 +4,11 @@ import { PostsService } from './posts.service';
import { InViewDirective } from './in-view.directive';

@Component({
selector: 'query-posts-page',
standalone: true,
imports: [CommonModule, InViewDirective],
templateUrl: './posts-page.component.html',
styles: [],
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'query-posts-page',
imports: [CommonModule, InViewDirective],
templateUrl: './posts-page.component.html',
styles: [],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PostsPageComponent {
posts$ = inject(PostsService).getPosts().result$;
11 changes: 5 additions & 6 deletions src/app/intersecting-page/intersecting-page.component.ts
Original file line number Diff line number Diff line change
@@ -5,12 +5,11 @@ import { intersectResults, intersectResults$ } from '@ngneat/query';
import { combineLatest } from 'rxjs';

@Component({
selector: 'query-intersecting-page',
standalone: true,
imports: [CommonModule],
templateUrl: './intersecting-page.component.html',
styles: [],
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'query-intersecting-page',
imports: [CommonModule],
templateUrl: './intersecting-page.component.html',
styles: [],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class IntersectingPageComponent {
#todosService = inject(TodosService);
9 changes: 4 additions & 5 deletions src/app/mutation-page/mutation-page.component.ts
Original file line number Diff line number Diff line change
@@ -7,11 +7,10 @@ import { TodosService } from '../services/todos.service';
import { TabsComponent } from '../ui/query-tabs/tabs.component';
import { TabComponent } from '../ui/query-tab/tab.component';
@Component({
selector: 'query-mutation-page',
standalone: true,
imports: [CommonModule, FormsModule, TabsComponent, TabComponent],
templateUrl: './mutation-page.component.html',
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'query-mutation-page',
imports: [CommonModule, FormsModule, TabsComponent, TabComponent],
templateUrl: './mutation-page.component.html',
changeDetection: ChangeDetectionStrategy.OnPush
})
export class MutationPageComponent {
#useIsMutating = injectIsMutating();
11 changes: 5 additions & 6 deletions src/app/pagination-page/pagination-page.component.ts
Original file line number Diff line number Diff line change
@@ -6,12 +6,11 @@ import { TabsComponent } from '../ui/query-tabs/tabs.component';
import { TabComponent } from '../ui/query-tab/tab.component';

@Component({
selector: 'query-pagination-page',
standalone: true,
imports: [CommonModule, TabsComponent, TabComponent],
templateUrl: './pagination-page.component.html',
styleUrls: ['./pagination-page.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'query-pagination-page',
imports: [CommonModule, TabsComponent, TabComponent],
templateUrl: './pagination-page.component.html',
styleUrls: ['./pagination-page.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PaginationPageComponent {
#page = new BehaviorSubject(0);
11 changes: 5 additions & 6 deletions src/app/prefetch-page/prefetch-page.component.ts
Original file line number Diff line number Diff line change
@@ -3,12 +3,11 @@ import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { Todo } from '../services/todos.service';

@Component({
selector: 'query-prefetch-page',
standalone: true,
imports: [CommonModule],
templateUrl: './prefetch-page.component.html',
styles: [],
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'query-prefetch-page',
imports: [CommonModule],
templateUrl: './prefetch-page.component.html',
styles: [],
changeDetection: ChangeDetectionStrategy.OnPush
})
export class PrefetchPageComponent {
@Input() todos: Todo[] = [];
9 changes: 4 additions & 5 deletions src/app/ui/query-tab/tab.component.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { Component, Input } from '@angular/core';

@Component({
selector: 'query-tab',
standalone: true,
imports: [],
templateUrl: './tab.component.html',
styles: '',
selector: 'query-tab',
imports: [],
templateUrl: './tab.component.html',
styles: ''
})
export class TabComponent {
@Input({ required: true }) title = '';
11 changes: 5 additions & 6 deletions src/app/ui/query-tabs/tabs.component.ts
Original file line number Diff line number Diff line change
@@ -8,16 +8,15 @@ import { NgComponentOutlet, NgForOf } from '@angular/common';
import { TabComponent } from '../query-tab/tab.component';

@Component({
selector: 'query-tabs',
standalone: true,
imports: [NgForOf, NgComponentOutlet],
templateUrl: './tabs.component.html',
styles: `
selector: 'query-tabs',
imports: [NgForOf, NgComponentOutlet],
templateUrl: './tabs.component.html',
styles: `
.is-active-tab a {
color: #b93eff;
border-bottom-color: #b93eff;
}
`,
`
})
export class TabsComponent implements AfterContentInit {
@ContentChildren(TabComponent, { read: TabComponent })

0 comments on commit f6f79a1

Please sign in to comment.