-
Notifications
You must be signed in to change notification settings - Fork 50
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
devtools docs #338
Draft
mercillo
wants to merge
13
commits into
player-ui:main
Choose a base branch
from
mercillo:PLAYA8852/devtolsDocs
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
devtools docs #338
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
a94eb34
devtools docs WIP
mercillo 99fd25b
devtools site
mercillo 38d8f91
Merge branch 'main' into PLAYA8852/devtolsDocs
mercillo c2cab0a
added more info on usage
3ed6241
updated with comment suggestions and codeblock
a9c2af1
removed redesigned portion
6cb26d2
capitalization
3c0c307
Merge branch 'main' into PLAYA8852/devtolsDocs
mercillo 9ea44f6
Merge branch 'main' into PLAYA8852/devtolsDocs
mercillo 7d1c45f
updated content for devtools website
125379e
added download link for chrome
827be24
updated Firefox spacing
62172e2
Merge branch 'main' into PLAYA8852/devtolsDocs
rafbcampos 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
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,47 @@ | ||||||
# Devtools | ||||||
|
||||||
## Introduction | ||||||
It is essential to have developer tool extensions to ensure efficient debugging and inspection of the Player while it runs in the user's application. To make this possible, we have decided to utilize the Player's content and plugin system instead of defining a limited set of features. This approach enables users to represent their specific requirements and utilize the Player to its full potential. | ||||||
|
||||||
## Devtools Architecture | ||||||
The Devtools extension utilizes an instance of Player to take advantage of its plugin system. Plugin authors can choose which hooks to use, what information to collect, and how to interact with it. | ||||||
|
||||||
The extension and the inspected instance of Player communicate through a Messenger class that is injected into the content script. The Messenger class is an efficient, agnostic, and self-sufficient layer that enables seamless communication between instances. You can find more information about the Devtools Messenger here: https://github.com/player-ui/tools/blob/3ca98bdc70c76e290084b75c5b8f26ebb35b0dd0/devtools/messenger/README.md. | ||||||
|
||||||
The @player-tools/devtools-client package provides a ReactPlayer panel that displays the content sent by the Player dev tool plugins on the inspected Player UI instance and the navigation bar. This allows users to create plugins according to their specific needs, rather than being restricted to a pre-defined set of features. Additionally, they can combine plugins and use different sets for each Player instance. This browser extension provides users with a high degree of flexibility and customization. | ||||||
|
||||||
## Usage | ||||||
To install the dev tool extension, go to the Chrome or Firefox store and download it. After that, register the dev tool plugins into the Player instance by following the same procedure as any other plugin. You can find more information about this in the Player configuration docs. | ||||||
|
||||||
Please note that dev tools plugins can affect your application's performance. Therefore, we recommend that you only register them when working in development environments. In case you accidentally register a plugin, the browser extension has a checkbox that you can use to enable or disable it. This is an effective way to avoid running plugins unnecessarily or forcing them on production environments. | ||||||
|
||||||
```javascript | ||||||
const testingPlugins: ReactPlayerOptions["plugins"] = [ | ||||||
new BasicWevDevtoolsPlugin() as unknown as ReactPlayerPlugin, | ||||||
]; | ||||||
|
||||||
const config: ReactPlayerOptions = { | ||||||
plugins: [ | ||||||
new ReferenceAssetsPlugin() as unknown as ReactPlayerPlugin, | ||||||
...testingPlugins, | ||||||
], | ||||||
}; | ||||||
``` | ||||||
|
||||||
|
||||||
## Devtools Basic Plugin | ||||||
We offer a basic devtools plugin at devtools/plugins/desktop/basic. This plugin includes features that we expect from a dev tools extension and can serve as an example for creating your own. | ||||||
|
||||||
|
||||||
## Devtools Assets | ||||||
You have the freedom to generate any content for your plugin, leveraging all the hooks that Player exposes. However, if you wish to use the Player's dev tool extension, you must use the devtools-assets as assets plugin. On the other hand, if you plan to maintain your extension, you are free to use any assets plugin. | ||||||
|
||||||
|
||||||
## How To Write Your Own Devtools Plugins | ||||||
We're currently working on a template for bootstraping you dev tools plugins. Meanwhile, you can use the (basic devtools plugin)[devtools/plugins/desktop/basic] and test it locally using the (test-env)[devtools/plugins/desktop/basic]. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
|
||||||
## Extension Downloads | ||||||
[Google Chrome](https://chromewebstore.google.com/detail/player-ui-devtools/oookcmbndmalnmacldppblmblakggabo) | ||||||
|
||||||
Firefox | Coming soon |
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.