-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Chore: Fix an issue with property renaming in polymer (#6401)
## Motivation for features / changes We keep the property renaming compiler flag turned off because of the many issues it causes with polymer. This should bring us one step closer towards enabling it. b/281726974 Googlers, see that this imports correctly cl/585788456 ## Technical description of changes The hack of creating custom elements and then referencing properties on them doesn't really work with property renaming turned on because the portions of the code which reference the properties are often not being changed. To get around this while still maintaining the binary seperation I am updating the code to write properties to `window` ## Screenshots of UI changes (or N/A) Properties are not being renamed ![image](https://github.com/tensorflow/tensorboard/assets/78179109/863f5cd7-4805-4e8f-bf82-309d3dd51716)
- Loading branch information
1 parent
6c06cc5
commit d0c5860
Showing
14 changed files
with
96 additions
and
88 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
42 changes: 42 additions & 0 deletions
42
tensorboard/webapp/tb_polymer_interop_type_definitions.d.ts
This file contains 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 @@ | ||
/* Copyright 2023 The TensorFlow Authors. All Rights Reserved. | ||
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. | ||
==============================================================================*/ | ||
declare global { | ||
interface Window { | ||
tensorboard: { | ||
tf_storage: TfStorage; | ||
tf_globals: TfGlobals; | ||
}; | ||
} | ||
} | ||
|
||
export interface SetStringOption { | ||
defaultValue?: string; | ||
/** | ||
* When true, setting the string does not push a new state onto the history. | ||
* i.e., it uses `history.replaceState` instead of `history.pushState`. | ||
*/ | ||
useLocationReplace?: boolean; | ||
} | ||
|
||
export interface TfStorage { | ||
setString(key: string, value: string, options?: SetStringOption): void; | ||
getString(key: string): string; | ||
migrateLegacyURLScheme(): void; | ||
getUrlHashDict(): Record<string, string>; | ||
} | ||
|
||
export interface TfGlobals { | ||
setUseHash(use: boolean): void; | ||
} |
This file contains 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