Commit 0cc8e0c
committed
deploy: fix(ui): remove module from script (googleapis#2703)
Removed `type="module"` from the script with DOM content.
Explanation of the chain of events that is happening currently:
* tools.html loads. It sees <script type="module"
src="/ui/js/tools.js"></script> and the inline <script type="module">
containing renderMainContent() call.
* Because both are modules, the browser waits until the HTML is fully
parsed, then executes them strictly in the order they appear in the
file.
* tools.js executes and attaches its DOMContentLoaded listener.
* The inline script executes and attaches its DOMContentLoaded listener.
* The DOM finishes loading. The browser fires the DOMContentLoaded
event.
* tools.js handles the event first. It runs the code on Line 27, looks
for tool-display-area, but it doesn't exist yet because the inline
script (which calls renderMainContent(...) to build that element) hasn't
run its event handler yet
Without the `type="module"`, it is now a standard script. The browser
will pause HTML parsing, executes the script immediately, and registers
the DOMContentLoaded listener first.
If we want to transition to using ES modules in the future, we will have
to rearrange the scripts. For now, modules is not necessary in this use
case. Hence defaulted to standard script.
Co-authored-by: Averi Kitsch <akitsch@google.com> 6943ab61 parent 6601e66 commit 0cc8e0c
386 files changed
Lines changed: 1708 additions & 785 deletions
File tree
- dev
- about
- faq
- blogs
- categories
- concepts
- telemetry
- getting-started
- configure
- introduction
- local_quickstart_go
- local_quickstart_js
- local_quickstart
- mcp_quickstart
- prompts_quickstart_gemini_cli
- how-to
- connect-ide
- alloydb_pg_admin_mcp
- alloydb_pg_mcp
- bigquery_mcp
- cloud_sql_mssql_admin_mcp
- cloud_sql_mssql_mcp
- cloud_sql_mysql_admin_mcp
- cloud_sql_mysql_mcp
- cloud_sql_pg_admin_mcp
- cloud_sql_pg_mcp
- firestore_mcp
- looker_mcp
- mssql_mcp
- mysql_mcp
- neo4j_mcp
- postgres_mcp
- spanner_mcp
- sqlite_mcp
- connect_via_geminicli
- connect_via_mcp
- deploy_adk_agent
- deploy_docker
- deploy_gke
- deploy_toolbox
- export_telemetry
- generate_skill
- invoke_tool
- toolbox-ui
- reference
- cli
- prebuilt-tools
- resources
- authservices
- google
- embeddingmodels
- gemini
- prompts
- custom
- sources
- alloydb-admin
- alloydb-pg
- bigquery
- bigtable
- cassandra
- clickhouse
- cloud-gda
- cloud-healthcare
- cloud-logging-admin
- cloud-monitoring
- cloud-sql-admin
- cloud-sql-mssql
- cloud-sql-mysql
- cloud-sql-pg
- cockroachdb
- couchbase
- dataplex
- dataproc
- dgraph
- elasticsearch
- firebird
- firestore
- http
- looker
- mariadb
- mindsdb
- mongodb
- mssql
- mysql
- neo4j
- oceanbase
- oracle
- postgres
- redis
- serverless-spark
- singlestore
- snowflake
- spanner
- sqlite
- tidb
- trino
- valkey
- yugabytedb
- tools
- alloydbainl
- alloydb-ai-nl
- alloydb
- alloydb-create-cluster
- alloydb-create-instance
- alloydb-create-user
- alloydb-get-cluster
- alloydb-get-instance
- alloydb-get-user
- alloydb-list-clusters
- alloydb-list-instances
- alloydb-list-users
- alloydb-wait-for-operation
- bigquery
- bigquery-analyze-contribution
- bigquery-conversational-analytics
- bigquery-execute-sql
- bigquery-forecast
- bigquery-get-dataset-info
- bigquery-get-table-info
- bigquery-list-dataset-ids
- bigquery-list-table-ids
- bigquery-search-catalog
- bigquery-sql
- bigtable
- bigtable-sql
- cassandra
- cassandra-cql
- clickhouse
- clickhouse-execute-sql
- clickhouse-list-databases
- clickhouse-list-tables
- clickhouse-sql
- cloudgda
- cloud-gda-query
- cloudhealthcare
- cloud-healthcare-fhir-fetch-page
- cloud-healthcare-fhir-patient-everything
- cloud-healthcare-fhir-patient-search
- cloud-healthcare-get-dataset
- cloud-healthcare-get-dicom-store-metrics
- cloud-healthcare-get-dicom-store
- cloud-healthcare-get-fhir-resource
- cloud-healthcare-get-fhir-store-metrics
- cloud-healthcare-get-fhir-store
- cloud-healthcare-list-dicom-stores
- cloud-healthcare-list-fhir-stores
- cloud-healthcare-retrieve-rendered-dicom-instance
- cloud-healthcare-search-dicom-instances
- cloud-healthcare-search-dicom-series
- cloud-healthcare-search-dicom-studies
- cloudloggingadmin
- cloud-logging-admin-list-log-names
- cloud-logging-admin-list-resource-types
- cloud-logging-admin-query-logs
- cloudmonitoring
- cloud-monitoring-query-prometheus
- cloudsql
- cloudsqlcloneinstance
- cloudsqlcreatebackup
- cloudsqlcreatedatabase
- cloudsqlcreateusers
- cloudsqlgetinstances
- cloudsqllistdatabases
- cloudsqllistinstances
- cloudsqlmssqlcreateinstance
- cloudsqlmysqlcreateinstance
- cloudsqlpgcreateinstances
- cloudsqlpgupgradeprecheck
- cloudsqlrestorebackup
- cloudsqlwaitforoperation
- cockroachdb
- cockroachdb-execute-sql
- cockroachdb-list-schemas
- cockroachdb-list-tables
- cockroachdb-sql
- couchbase
- couchbase-sql
- dataform
- dataform-compile-local
- dataplex
- dataplex-lookup-entry
- dataplex-search-aspect-types
- dataplex-search-entries
- dataproc
- dataproc-get-cluster
- dataproc-get-job
- dataproc-list-clusters
- dataproc-list-jobs
- dgraph
- dgraph-dql
- elasticsearch
- elasticsearch-esql
- firebird
- firebird-execute-sql
- firebird-sql
- firestore
- firestore-add-documents
- firestore-delete-documents
- firestore-get-documents
- firestore-get-rules
- firestore-list-collections
- firestore-query-collection
- firestore-query
- firestore-update-document
- firestore-validate-rules
- http
- http
- looker
- looker-add-dashboard-element
- looker-add-dashboard-filter
- looker-conversational-analytics
- looker-create-project-directory
- looker-create-project-file
- looker-create-view-from-table
- looker-delete-project-directory
- looker-delete-project-file
- looker-dev-mode
- looker-generate-embed-url
- looker-get-connection-databases
- looker-get-connection-schemas
- looker-get-connection-table-columns
- looker-get-connection-tables
- looker-get-connections
- looker-get-dashboards
- looker-get-dimensions
- looker-get-explores
- looker-get-filters
- looker-get-lookml-tests
- looker-get-looks
- looker-get-measures
- looker-get-models
- looker-get-parameters
- looker-get-project-directories
- looker-get-project-files
- looker-get-project-file
- looker-get-projects
- looker-health-analyze
- looker-health-pulse
- looker-health-vacuum
- looker-make-dashboard
- looker-make-look
- looker-query-sql
- looker-query-url
- looker-query
- looker-run-dashboard
- looker-run-lookml-tests
- looker-run-look
- looker-update-project-file
- looker-validate-project
- mindsdb
- mindsdb-execute-sql
- mindsdb-sql
- mongodb
- mongodb-aggregate
- mongodb-delete-many
- mongodb-delete-one
- mongodb-find-one
- mongodb-find
- mongodb-insert-many
- mongodb-insert-one
- mongodb-update-many
- mongodb-update-one
- mssql
- mssql-execute-sql
- mssql-list-tables
- mssql-sql
- mysql
- mysql-execute-sql
- mysql-get-query-plan
- mysql-list-active-queries
- mysql-list-table-fragmentation
- mysql-list-tables-missing-unique-indexes
- mysql-list-tables
- mysql-sql
- neo4j
- neo4j-cypher
- neo4j-execute-cypher
- neo4j-schema
- oceanbase
- oceanbase-execute-sql
- oceanbase-sql
- oracle
- oracle-execute-sql
- oracle-sql
- postgres
- postgres-database-overview
- postgres-execute-sql
- postgres-get-column-cardinality
- postgres-list-active-queries
- postgres-list-available-extensions
- postgres-list-database-stats
- postgres-list-indexes
- postgres-list-installed-extensions
- postgres-list-locks
- postgres-list-pg-settings
- postgres-list-publication-tables
- postgres-list-query-stats
- postgres-list-roles
- postgres-list-schemas
- postgres-list-sequences
- postgres-list-stored-procedure
- postgres-list-table-stats
- postgres-list-tablespaces
- postgres-list-tables
- postgres-list-triggers
- postgres-list-views
- postgres-long-running-transactions
- postgres-replication-stats
- postgres-sql
- redis
- redis
- serverless-spark-get-session-template
- serverless-spark
- serverless-spark-cancel-batch
- serverless-spark-create-pyspark-batch
- serverless-spark-create-spark-batch
- serverless-spark-get-batch
- serverless-spark-get-session-template
- serverless-spark-get-session
- serverless-spark-list-batches
- serverless-spark-list-sessions
- singlestore
- singlestore-execute-sql
- singlestore-sql
- snowflake
- snowflake-execute-sql
- snowflake-sql
- spanner
- spanner-execute-sql
- spanner-list-graphs
- spanner-list-tables
- spanner-sql
- sqlite
- sqlite-execute-sql
- sqlite-sql
- tidb
- tidb-execute-sql
- tidb-sql
- trino
- trino-execute-sql
- trino-sql
- utility
- wait
- valkey
- valkey
- yuagbytedb
- yugabytedb-sql
- samples
- alloydb
- ai-nl
- mcp_quickstart
- bigquery
- local_quickstart
- mcp_quickstart
- looker
- looker_gemini_oauth
- looker_gemini
- looker_mcp_inspector
- neo4j
- mcp_quickstart
- pre_post_processing
- go
- js
- adk
- python
- snowflake
- sdks
- go-sdk
- core
- tbadk
- tbgenkit
- js-sdk
- adk
- core
- python-sdk
- adk
- core
- langchain
- llamaindex
- tags
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
306 | 306 | | |
307 | 307 | | |
308 | 308 | | |
309 | | - | |
| 309 | + | |
| 310 | + | |
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
| |||
0 commit comments