You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/05/01 15:16:43 UTC
[GitHub] [cordova-electron] erisu edited a comment on pull request #137: Proposed Feature: Load DevToolExtensions from electron configuration
erisu edited a comment on pull request #137:
URL: https://github.com/apache/cordova-electron/pull/137#issuecomment-622429032
@rharriso Sorry for a late reply :D
I was looking into doing something similar before you submitted your PR. I do believe we should provide users the ability to have access to these Dev Tool extensions and it is a great idea.
In this PR, this was one type of implementation that I investigated but I felt it would rely on Cordova users to understand how to get those extension paths.
But, I was leaning more towards a different type of implementation.
I think we could leverage the [electron-devtools-installer](https://github.com/MarshallOfSound/electron-devtools-installer) npm package instead to get the extension's path so users don't need to do that.
Even Electron mentions this package in their first paragraph. https://www.electronjs.org/docs/tutorial/devtools-extension#how-to-load-a-devtools-extension
Here is a usage example of the library:
```
const { default: installExtension, REACT_DEVELOPER_TOOLS } = require('electron-devtools-installer');
const { app } = require('electron');
app.whenReady().then(() => {
installExtension(REDUX_DEVTOOLS)
.then((name) => console.log(`Added Extension: ${name}`))
.catch((err) => console.log('An error occurred: ', err));
});
```
Here is a full list of extensions this library helps.
* `EMBER_INSPECTOR`
* `REACT_DEVELOPER_TOOLS`
* `BACKBONE_DEBUGGER`
* `JQUERY_DEBUGGER`
* `ANGULARJS_BATARANG`
* `VUEJS_DEVTOOLS`
* `REDUX_DEVTOOLS`
* `REACT_PERF`
* `CYCLEJS_DEVTOOL`
* `MOBX_DEVTOOLS`
* `APOLLO_DEVELOPER_TOOLS`
When using this library, we could just load them all at once and if the user doesn't have that extension, just make sure it doesn't hard fail and continue. Even if they have the extension, I do not think all of them will display if the source does not need it. For example, I believe the VueJS extension checks if the source code is vue before displaying in the dev tools even if the extension loaded.
Another option is we could convert the `devToolExtensions` array which the PR uses and the values are these keys from the library. Additionally, keys can be any extension ID even if it doesn't exist.
> Simply find the ChromeStore ID of the extension you want to install, and call installExtension('YOUR_ID_HERE').
Do you want to take a look and try to implement this?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org