-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat: set up Angular infrastructure for TableWidget #16934
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
Draft
shuoweil
wants to merge
4
commits into
main
Choose a base branch
from
shuowei-angular
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.
Draft
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
88fcf76
feat: set up Angular infrastructure for TableWidget
shuoweil 2393021
feat: implement DOM sanitization in Angular bridge
shuoweil 49b7977
feat: address code review comments and add license headers
shuoweil 2b6a9fb
test: test pre-commit hook after noxfile fix
shuoweil 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
There are no files selected for viewing
5,154 changes: 5,154 additions & 0 deletions
5,154
packages/bigframes/bigframes/display/table_widget_angular.js
Large diffs are not rendered by default.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
packages/bigframes/bigframes/display/table_widget_angular/.editorconfig
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 |
44 changes: 44 additions & 0 deletions
44
packages/bigframes/bigframes/display/table_widget_angular/.gitignore
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 |
12 changes: 12 additions & 0 deletions
12
packages/bigframes/bigframes/display/table_widget_angular/.prettierrc
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" | ||
| } | ||
| } | ||
| ] | ||
| } |
59 changes: 59 additions & 0 deletions
59
packages/bigframes/bigframes/display/table_widget_angular/README.md
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 @@ | ||
| # TableWidgetAngular | ||
|
|
||
| This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 21.2.9. | ||
|
|
||
| ## 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. | ||
73 changes: 73 additions & 0 deletions
73
packages/bigframes/bigframes/display/table_widget_angular/angular.json
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,73 @@ | ||
| { | ||
| "$schema": "./node_modules/@angular/cli/lib/config/schema.json", | ||
| "version": 1, | ||
| "cli": { | ||
| "packageManager": "npm" | ||
| }, | ||
| "newProjectRoot": "projects", | ||
| "projects": { | ||
| "table-widget-angular": { | ||
| "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": "table-widget-angular:build:production" | ||
| }, | ||
| "development": { | ||
| "buildTarget": "table-widget-angular:build:development" | ||
| } | ||
| }, | ||
| "defaultConfiguration": "development" | ||
| }, | ||
| "test": { | ||
| "builder": "@angular/build:unit-test" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } |
26 changes: 26 additions & 0 deletions
26
packages/bigframes/bigframes/display/table_widget_angular/bundle.js
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,26 @@ | ||
| /* | ||
| * Copyright 2026 Google LLC | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| const esbuild = require('esbuild'); | ||
| const path = require('path'); | ||
|
|
||
| esbuild.build({ | ||
| entryPoints: [path.resolve(__dirname, 'dist/table-widget-angular/browser/main.js')], | ||
| bundle: true, | ||
| outfile: path.resolve(__dirname, '../table_widget_angular.js'), | ||
| format: 'esm', | ||
| logLevel: 'info', | ||
| }).catch(() => process.exit(1)); |
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Angular CLI version mentioned (21.2.9) does not exist. Please update this to reflect the actual version used (likely 19.x).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed. I have removed CommonModule from the imports to keep the component lightweight.