question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Subscribe auto/manual reload actions inside plugin context

See original GitHub issue

Hi folks.

We have a plugin that using our own API (And our own fetch logic). But we cannot detect any actions who emitted in the tensorboard container.

We could add event listeners on the refresh icon. But we have no idea about the auto reload.

Are there any existed way(Might some callback? hooks? etc.) to subscribe the [Core] Auto Reload or/and [Core] User Triggered Reload actions inside a plugin?

Thanks!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
psybuzzcommented, Apr 14, 2021

Thanks to @stephanwlee for working on this in https://github.com/tensorflow/tensorboard/pull/4846! Now that that PR landed, custom plugins loaded with the latest tb-nightly pip package should be able to listen for reload events.

The exact details on how a custom plugin should do that require some explaining, as we do not have any instructions in the documentation for how to use the plugin API.

To use the API within a custom plugin, one needs to:

  • Get the entry point in tensorboard/components/experimental/plugin_lib/index.ts
  • Bundle it with one’s favorite bundler (e.g. rollup, webpack, parcel, esbuild)
  • Serve the bundled script from your custom plugin’s backend and import it on the frontend
  • Call the API methods from their appropriate namespace, e.g. setOnReload is exposed on mylib.core.setOnReload(), while getting runs is exposed on mylib.runs.getRuns()

In PR, https://github.com/tensorflow/tensorboard/pull/4850, there is an example of how to do so with Bazel in particular.

Since we are missing some docs, please feel free to ask questions.

3reactions
psybuzzcommented, Apr 5, 2021

The dynamic plugin API currently does not have a great “how to access the API” story at the moment. Since the addition of this new setOnReloadFired requires some digging around the internals of TensorBoard and interop between Angular and Polymer, I will take a look.

The existing setOnRunsChanged shares some similarity, but that one does not touch Angular, which is where setOnReloadFired needs to get its events. https://github.com/tensorflow/tensorboard/blob/master/tensorboard/components/experimental/plugin_lib/runs.ts

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I auto-reload a Chrome extension I'm developing?
Create an extension, and use the Browser Action method in conjunction with the chrome.extension.management API to reload your unpacked extension.
Read more >
Auto Refresh Plus | Page Monitor
Auto Refresh Plus comes in handy to any user who needs to perform automatic web page refresh at certain times efficiently.
Read more >
API Reference: ApolloServer - Apollo GraphQL Docs
This article documents the ApolloServer class from the @apollo/server package. You can use the ApolloServer class to create an instance of Apollo Server ......
Read more >
pmndrs/zustand: Bear necessities for state ... - GitHub
The subscribe function allows components to bind to a state-portion without forcing re-render on changes. Best combine it with useEffect for automatic ......
Read more >
VS Code API | Visual Studio Code Extension API
VS Code API is a set of JavaScript APIs that you can invoke in your Visual Studio Code extension. This page lists all...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found