Skip to content
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

@types/vscode for extension usage #70175

Closed
octref opened this issue Mar 10, 2019 · 10 comments
Closed

@types/vscode for extension usage #70175

octref opened this issue Mar 10, 2019 · 10 comments
Assignees
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@octref
Copy link
Contributor

octref commented Mar 10, 2019

Update:

New system will:


Ref: microsoft/vscode-extension-vscode#147

DefinitelyTyped, question for publishing old versions of types: DefinitelyTyped/DefinitelyTyped#33738

Tracking here for testing later.

Current Problem:

  • vscode.d.ts is fetched by running a script, node_modules/vscode/install
  • The script depends on update server, so when it's down dependency install for extension fails
  • yarn and npm can't fully cache the vscode module

Proposed solution:

  • For each release of VS Code, we publish @types/vscode corresponding to the VS Code version. For example VS Code 1.32.0 => @types/vscode@1.32.0
  • We seldom have breaking API changes, so most people can roll with "@types/vscode": "^1.32.0" and always get latest API.

VS Code related changes:

Extension authors can use engines.vscode to specify which versions of VS Code their extensions support. With this change, engines.vscode is no long used for fetching corresponding dts files.

I think this is a good change. I want to develop always with latest vscode.d.ts but if I don't use any new API, I can still support older versions. If I want to lock to specific versions of vscode.d.ts I can always use exact version such as "@types/vscode": "1.32.0".

@octref octref self-assigned this Mar 10, 2019
@octref octref added extensions Issues concerning extensions feature-request Request for new features or functionality labels Mar 10, 2019
@octref
Copy link
Contributor Author

octref commented Mar 10, 2019

We might be able to include proposed dts in @types/vscode too. @jrieken should we do this?

@jrieken
Copy link
Member

jrieken commented Mar 11, 2019

@jrieken should we do this?

Not sure, not the biggest fan because proposed api changes a lot and proposed api doesn't work with vscode-stable, only insiders. having it out and published might send the wrong mesage

@octref
Copy link
Contributor Author

octref commented Mar 11, 2019

@jrieken And I assume we don't publish types for recovery build, such as 1.32.1, correct?

@jrieken
Copy link
Member

jrieken commented Mar 12, 2019

Yeah, we shouldn't as the API doesn't change

@octref
Copy link
Contributor Author

octref commented Mar 12, 2019

We'll publish 1.14 to 1.32 @types/vscode. This has to be done one PR per version.

  • Published: 1.14-1.32

Other tracking:

@octref octref added this to the March 2019 milestone Mar 13, 2019
@octref
Copy link
Contributor Author

octref commented Mar 13, 2019

@jrieken I plan to update the extension generator, so the template uses latest engine.vscode and @types/vscode.

Do you feel there's a need for vsce to check that the downloaded vscode.d.ts corresponds to engine.vscode? I can think of cases where author want to specify "fetched dts" and "supported VS Code version" differently, but during today's discussion there are concerns that users would use API only available in newer versions but forget to update engines.vscode.

@jrieken
Copy link
Member

jrieken commented Mar 14, 2019

Code version" differently, but during today's discussion there are concerns that users would use API only available in newer versions but forget to update engines.vscode.

Yeah, that's something something you get for free today and something we loose with the decoupling work. Yeah, I think adding a check to vsce and also some package.json validation makes sense.

@octref
Copy link
Contributor Author

octref commented Mar 17, 2019

This GitHub Action Event seems the right fit for us to automate @types publishing. Creating tag/<VERSION> in microsoft/vscode could send a PR to DefinitelyTyped.

@octref
Copy link
Contributor Author

octref commented Mar 25, 2019

@types/vscode 1.14 - 1.32 are published. More work is captured in #71048. I'll still focus on Vetur contribution in April and get back to this in May.

@octref octref closed this as completed Mar 25, 2019
@octref octref added the verification-needed Verification of issue is requested label Mar 26, 2019
@octref
Copy link
Contributor Author

octref commented Mar 26, 2019

No testplan item for this one because we aren't mentioning it publicly. When #71048 is shipped I'll create testplan item for it.

Verifier: Create a new extension, drop postinstall hook and vscode dependency and just use @types/vscode. Verify that IntelliSense and error-checking works. Alternatively, create a JS extension and do not install node_modules. Verify that Automatic Type Acquisition works.

@roblourens roblourens added the verified Verification succeeded label Mar 26, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators May 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
extensions Issues concerning extensions feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants