-
-
Notifications
You must be signed in to change notification settings - Fork 72
feat(angular): angular adapter and utils #368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
riccardoperra
wants to merge
24
commits into
TanStack:main
Choose a base branch
from
riccardoperra:feat/angular-adapter
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
d177032
feat(angular-devtools): create angular adapter package
AlemTuzlak f57a1cf
fix(angular-devtools): add reactivity for input changes, remove unuse…
AlemTuzlak e1ac556
feat(devtools-utils): add angular support
AlemTuzlak 5a756e5
fix: resolve angular build issues
AlemTuzlak 7c18c00
ci: apply automated fixes
autofix-ci[bot] 76029ca
fix: resolve lint, knip, and sherif issues
AlemTuzlak 06e8011
feat: add Angular support with setup, adapter, and custom plugin docu…
AlemTuzlak 1683fc8
feat(angular): angular adapter add utils and some examples, fix build
riccardoperra c06025d
ci: apply automated fixes
autofix-ci[bot] d81e976
feat: Add angular adapter and devtools-utils/angular
riccardoperra e3e4011
remove afterNextRender in devtools-utils
riccardoperra d74c1f4
fix examples
riccardoperra 058a2ee
fix angular devtools wrong pnpm link
riccardoperra c52c310
feat(angular-devtools): add with-devtools provider
riccardoperra f16f2ff
docs(angular-devtools): update docs
riccardoperra dc62a0d
ci: apply automated fixes
autofix-ci[bot] c728cfe
chore(angular-devtools): fix examples dependencies and knip issues
riccardoperra fd8bb54
feat(angular-devtools): rename withDevtools to provideTanStackDevtools
riccardoperra ed5c27c
Merge remote-tracking branch 'origin/main' into feat/angular-adapter
riccardoperra 4ebeb9e
Merge remote-tracking branch 'origin/main' into feat/angular-adapter
riccardoperra dd5f9c7
Merge remote-tracking branch 'origin/main' into feat/angular-adapter
riccardoperra 0a9ac06
Add a11y plugin for angular
riccardoperra b6652ab
Merge remote-tracking branch 'origin/main' into feat/angular-adapter
riccardoperra bb595b8
chore(deps): update @tanstack/devtools and related packages
riccardoperra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
feat(angular): angular adapter add utils and some examples, fix build
- Loading branch information
commit 1683fc85402a48af7be2d762ac8df8ec5ae9c74f
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Editor configuration, see https://editorconfig.org | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| indent_style = space | ||
| indent_size = 2 | ||
| insert_final_newline = true | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [*.ts] | ||
| quote_type = single | ||
| ij_typescript_use_double_quotes = false | ||
|
|
||
| [*.md] | ||
| max_line_length = off | ||
| trim_trailing_whitespace = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # See https://docs.github.com/get-started/getting-started-with-git/ignoring-files for more about ignoring files. | ||
|
|
||
| # Compiled output | ||
| /dist | ||
| /tmp | ||
| /out-tsc | ||
| /bazel-out | ||
|
|
||
| # Node | ||
| /node_modules | ||
| npm-debug.log | ||
| yarn-error.log | ||
|
|
||
| # IDEs and editors | ||
| .idea/ | ||
| .project | ||
| .classpath | ||
| .c9/ | ||
| *.launch | ||
| .settings/ | ||
| *.sublime-workspace | ||
|
|
||
| # Visual Studio Code | ||
| .vscode/* | ||
| !.vscode/settings.json | ||
| !.vscode/tasks.json | ||
| !.vscode/launch.json | ||
| !.vscode/extensions.json | ||
| !.vscode/mcp.json | ||
| .history/* | ||
|
|
||
| # Miscellaneous | ||
| /.angular/cache | ||
| .sass-cache/ | ||
| /connect.lock | ||
| /coverage | ||
| /libpeerconnection.log | ||
| testem.log | ||
| /typings | ||
| __screenshots__/ | ||
|
|
||
| # System files | ||
| .DS_Store | ||
| Thumbs.db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "printWidth": 100, | ||
| "singleQuote": true, | ||
| "overrides": [ | ||
| { | ||
| "files": "*.html", | ||
| "options": { | ||
| "parser": "angular" | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 | ||
| "recommendations": ["angular.ng-template"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| { | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
| "version": "0.2.0", | ||
| "configurations": [ | ||
| { | ||
| "name": "ng serve", | ||
| "type": "chrome", | ||
| "request": "launch", | ||
| "preLaunchTask": "npm: start", | ||
| "url": "http://localhost:4200/" | ||
| }, | ||
| { | ||
| "name": "ng test", | ||
| "type": "chrome", | ||
| "request": "launch", | ||
| "preLaunchTask": "npm: test", | ||
| "url": "http://localhost:9876/debug.html" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| // For more information, visit: https://angular.dev/ai/mcp | ||
| "servers": { | ||
| "angular-cli": { | ||
| "command": "npx", | ||
| "args": ["-y", "@angular/cli", "mcp"] | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| { | ||
| // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 | ||
| "version": "2.0.0", | ||
| "tasks": [ | ||
| { | ||
| "type": "npm", | ||
| "script": "start", | ||
| "isBackground": true, | ||
| "problemMatcher": { | ||
| "owner": "typescript", | ||
| "pattern": "$tsc", | ||
| "background": { | ||
| "activeOnStart": true, | ||
| "beginsPattern": { | ||
| "regexp": "Changes detected" | ||
| }, | ||
| "endsPattern": { | ||
| "regexp": "bundle generation (complete|failed)" | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| { | ||
| "type": "npm", | ||
| "script": "test", | ||
| "isBackground": true, | ||
| "problemMatcher": { | ||
| "owner": "typescript", | ||
| "pattern": "$tsc", | ||
| "background": { | ||
| "activeOnStart": true, | ||
| "beginsPattern": { | ||
| "regexp": "Changes detected" | ||
| }, | ||
| "endsPattern": { | ||
| "regexp": "bundle generation (complete|failed)" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| # Basic | ||
|
|
||
| This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.2.0. | ||
|
|
||
| ## Development server | ||
|
|
||
| To start a local development server, run: | ||
|
|
||
| ```bash | ||
| ng serve | ||
| ``` | ||
|
|
||
| Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files. | ||
|
|
||
| ## Code scaffolding | ||
|
|
||
| Angular CLI includes powerful code scaffolding tools. To generate a new component, run: | ||
|
|
||
| ```bash | ||
| ng generate component component-name | ||
| ``` | ||
|
|
||
| For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run: | ||
|
|
||
| ```bash | ||
| ng generate --help | ||
| ``` | ||
|
|
||
| ## Building | ||
|
|
||
| To build the project run: | ||
|
|
||
| ```bash | ||
| ng build | ||
| ``` | ||
|
|
||
| This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed. | ||
|
|
||
| ## Running unit tests | ||
|
|
||
| To execute unit tests with the [Vitest](https://vitest.dev/) test runner, use the following command: | ||
|
|
||
| ```bash | ||
| ng test | ||
| ``` | ||
|
|
||
| ## Running end-to-end tests | ||
|
|
||
| For end-to-end (e2e) testing, run: | ||
|
|
||
| ```bash | ||
| ng e2e | ||
| ``` | ||
|
|
||
| Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs. | ||
|
|
||
| ## Additional Resources | ||
|
|
||
| For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| { | ||
| "$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
| "version": 1, | ||
| "cli": { | ||
| "packageManager": "pnpm", | ||
| "analytics": false, | ||
| "cache": { | ||
| "enabled": false | ||
| } | ||
| }, | ||
| "newProjectRoot": "projects", | ||
| "projects": { | ||
| "basic": { | ||
| "projectType": "application", | ||
| "schematics": {}, | ||
| "root": "", | ||
| "sourceRoot": "src", | ||
| "prefix": "app", | ||
| "architect": { | ||
| "build": { | ||
| "builder": "@angular/build:application", | ||
| "options": { | ||
| "browser": "src/main.ts", | ||
| "tsConfig": "tsconfig.app.json", | ||
| "assets": [ | ||
| { | ||
| "glob": "**/*", | ||
| "input": "public" | ||
| } | ||
| ], | ||
| "styles": ["src/styles.css"] | ||
| }, | ||
| "configurations": { | ||
| "production": { | ||
| "budgets": [ | ||
| { | ||
| "type": "initial", | ||
| "maximumWarning": "500kB", | ||
| "maximumError": "1MB" | ||
| }, | ||
| { | ||
| "type": "anyComponentStyle", | ||
| "maximumWarning": "4kB", | ||
| "maximumError": "8kB" | ||
| } | ||
| ], | ||
| "outputHashing": "all" | ||
| }, | ||
| "development": { | ||
| "optimization": false, | ||
| "extractLicenses": false, | ||
| "sourceMap": true | ||
| } | ||
| }, | ||
| "defaultConfiguration": "production" | ||
| }, | ||
| "serve": { | ||
| "builder": "@angular/build:dev-server", | ||
| "configurations": { | ||
| "production": { | ||
| "buildTarget": "basic:build:production" | ||
| }, | ||
| "development": { | ||
| "buildTarget": "basic:build:development" | ||
| } | ||
| }, | ||
| "defaultConfiguration": "development" | ||
| }, | ||
| "test": { | ||
| "builder": "@angular/build:unit-test" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| { | ||
| "name": "basic", | ||
| "version": "0.0.0", | ||
| "scripts": { | ||
| "ng": "ng", | ||
| "start": "ng serve", | ||
| "build": "ng build", | ||
| "watch": "ng build --watch --configuration development", | ||
| "test": "ng test" | ||
| }, | ||
| "private": true, | ||
| "packageManager": "pnpm@10.24.0", | ||
| "dependencies": { | ||
| "@angular/common": "^21.2.0", | ||
| "@angular/compiler": "^21.2.0", | ||
| "@angular/core": "^21.2.0", | ||
| "@angular/forms": "^21.2.0", | ||
| "@angular/platform-browser": "^21.2.0", | ||
| "@angular/router": "^21.2.0", | ||
| "@tanstack/angular-devtools": "workspace:*", | ||
| "@tanstack/devtools": "workspace:^", | ||
| "@tanstack/devtools-event-client": "workspace:*", | ||
| "rxjs": "~7.8.0", | ||
| "tslib": "^2.3.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@angular/build": "^21.2.0", | ||
| "@angular/cli": "^21.2.0", | ||
| "@angular/compiler-cli": "^21.2.0", | ||
| "jsdom": "^28.0.0", | ||
| "ng-packagr": "^21.2.0", | ||
| "prettier": "^3.8.1", | ||
| "typescript": "~5.9.2", | ||
| "vitest": "^4.0.8" | ||
| } | ||
| } |
Binary file not shown.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| import { ApplicationConfig, provideBrowserGlobalErrorListeners } from '@angular/core'; | ||
|
|
||
| export const appConfig: ApplicationConfig = { | ||
| providers: [provideBrowserGlobalErrorListeners()], | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| import { | ||
| ChangeDetectionStrategy, | ||
| Component, | ||
| reflectComponentType, | ||
| signal, | ||
| Type, | ||
| } from '@angular/core'; | ||
| import { createCounter } from './counter'; | ||
| import type { TanStackDevtoolsAngularInit } from '@tanstack/angular-devtools'; | ||
| import { CustomDevtoolPanel } from './devtools/custom-devtools-panel'; | ||
| import { TanStackDevtoolsComponent } from '@tanstack/angular-devtools'; | ||
|
|
||
| @Component({ | ||
| selector: 'app-root', | ||
| imports: [TanStackDevtoolsComponent], | ||
| template: ` | ||
| <div> | ||
| <h1>Custom plugins</h1> | ||
| <h2>Count: {{ counter.value() }}</h2> | ||
| <div style="display: flex; gap: 4px"> | ||
| <button (click)="increment()">+ increase</button> | ||
| <button (click)="decrement()">− decrease</button> | ||
| </div> | ||
| </div> | ||
|
|
||
| <tanstack-devtools [plugins]="plugins()" [eventBusConfig]="{ debug: true }" /> | ||
| `, | ||
| changeDetection: ChangeDetectionStrategy.OnPush, | ||
| }) | ||
| export class App { | ||
| readonly plugins = signal<NonNullable<TanStackDevtoolsAngularInit['plugins']>>([ | ||
| { | ||
| name: 'Custom devtools', | ||
| render: CustomDevtoolPanel, | ||
| }, | ||
| ]); | ||
|
|
||
| readonly counter = createCounter(); | ||
|
|
||
| readonly increment = () => this.counter.increment(); | ||
| readonly decrement = () => this.counter.decrement(); | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.