Refactoring (#4223)

* Replace var with const in js/app/src/main.ts

* Remove unnecessary nullish coalescing in js/app/src/main.ts

* Remove unnecessary white spaces in the NPM scripts in js/app/package.json

* Use object key-value shorthand

* changelog

---------

Co-authored-by: pngwn <hello@pngwn.io>
This commit is contained in:
Yuichiro Tachibana (Tsuchiya) 2023-05-17 13:29:32 +03:00 committed by GitHub
parent 5c3fd1b5aa
commit b0cccb43d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 6 deletions

View File

@ -8,7 +8,7 @@ No changes to highlight.
## Other Changes:
No changes to highlight.
- Refactor web component `initial_height` attribute by [@whitphx](https://github.com/whitphx) in [PR 4223](https://github.com/gradio-app/gradio/pull/4223)
## Breaking Changes:

View File

@ -5,8 +5,8 @@
"scripts": {
"dev": "vite --port 9876",
"build:cdn": "vite build --mode production:cdn --emptyOutDir",
"build:website": "vite build --mode production:website --emptyOutDir",
"build:local": "vite build --mode production:local --emptyOutDir",
"build:website": "vite build --mode production:website --emptyOutDir",
"build:local": "vite build --mode production:local --emptyOutDir",
"preview": "vite preview",
"test:snapshot": "pnpm exec playwright test snapshots/ --config=../../.config/playwright.config.js",
"test:browser": "pnpm exec playwright test test/ --config=../../.config/playwright.config.js",

View File

@ -49,7 +49,7 @@ function create_custom_element() {
composed: true
});
var observer = new MutationObserver((mutations) => {
const observer = new MutationObserver((mutations) => {
this.dispatchEvent(event);
});
@ -79,11 +79,11 @@ function create_custom_element() {
info: info === "false" ? false : true,
container: container === "false" ? false : true,
is_embed: is_embed === "false" ? false : true,
initial_height: initial_height ?? undefined,
initial_height,
eager: eager === "true" ? true : false,
// gradio meta info
version: GRADIO_VERSION,
theme_mode: theme_mode,
theme_mode,
// misc global behaviour
autoscroll: autoscroll === "true" ? true : false,
control_page_title: control_page_title === "true" ? true : false,