Support async plugins / extensions
See original GitHub issueCode I’d like to write:
import { ghauth } from "../util/promised_ghauth"
import { Context } from "../context"
const setGithubCredentials = async (context: Context) => {
context.githubAuth = await ghauth()
}
module.exports = setGithubCredentials
and
import { getSettings } from "../util/settings"
import { Context } from "../context"
const setSettings = async (context: Context) => {
context.settings = await getSettings()
}
module.exports = setSettings
The GH Auth prompt does a bunch of pre-requisite work, it’s feasible that I can add a function to handle it per-command but it’s basically something I want on the first time user flow anyway.
I took a quick look at this and it seems like it’d add async code everywhere so opted to not PR right now and to move it to a function my command can handle as I only have one 😉
Opened so people can decide if this is something you want
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
AsyncPanel - Client-side Extensions - Atlassian Developer
An asynchronous panel extension allows the creation of custom HTML content in a container provided by the plugin system. This API works similar...
Read more >Chrome Extensions: Using promises
Promises are designed to deliver asynchronous results, both success and failure. A failure in a promise (a promise rejection) is handled ...
Read more >Updates to synchronous autoload of extensions in Visual ...
First, most extensions now support async background loading, which improves startup and solution load performance across the board.
Read more >Can extensions use async/await #1556 - microsoft/vscode
Using async/await works fine in a simple samples: https://github.com/egamma/vscode-extension-async (target set to ES6).
Read more >Javascript Async & Defer - Plugins - DayCounts
Install and publish the plugin. In the "scripts to modify" field, enter the path to the scripts to be loaded either in async...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Indeed! I like it. Though it might also be good to have it on
builder
too. Something like:Probably worth it’s own issue.
I’m realizing that my use case may be slightly different than the authors. But the idea would be like this: https://github.com/infinitered/gluegun/pull/449
Basically so I can have an extension like:
companySettings.ts
which hasEdit: or something like
updateCheck.ts
Though there’s an argument to be made for the latter being in
gluegun
itself.