Skip to content

feat: export server.bindCLIShortcuts#13675

Merged
bluwy merged 10 commits intovitejs:mainfrom
deot:main
Sep 4, 2023
Merged

feat: export server.bindCLIShortcuts#13675
bluwy merged 10 commits intovitejs:mainfrom
deot:main

Conversation

@deot
Copy link
Copy Markdown
Contributor

@deot deot commented Jun 29, 2023

Description

When i use createServer(Node API), expect to use keyboard shortcuts. can it export?

node/index.ts

export { bindShortcuts } from './shortcuts'
  • example
import { createServer, bindShortcuts } from 'vite'

...
const server = await createServer(...);
await server.listen();
bindShortcuts(server)

Additional context


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the PR Title Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@bolt-new-by-stackblitz
Copy link
Copy Markdown

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@ArnaudBarre
Copy link
Copy Markdown
Member

cc @bluwy this makes changing the behaviour of rawMode a lot more breaking. But that's fine if we change this only in Vite 5.

The printHelp option was there from the beginning to make this customisable later when using the JS API

@patak-cat
Copy link
Copy Markdown
Member

Should it be a method in server if we expose this?

@bluwy
Copy link
Copy Markdown
Member

bluwy commented Jul 5, 2023

Yeah making it server.bindShortcuts() feel more natural to me. As a start, we can also avoid exposing extending the shortcuts so it won't be a breaking change when we decide to add more.

@patak-cat patak-cat added the p2-nice-to-have Not breaking anything but nice to have (priority) label Jul 17, 2023
bluwy
bluwy previously approved these changes Jul 21, 2023
@patak-cat patak-cat added this to the 5.0 milestone Jul 21, 2023
@bluwy bluwy changed the title feat: export bindShortcuts from vite/node feat: export server.bindCLIShortcuts Sep 4, 2023
Copy link
Copy Markdown
Member

@bluwy bluwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Thanks for spotting the meeting notes and making the changes. We forgot to leave a comment about it 😅

@bluwy bluwy merged commit 1a2e5e6 into vitejs:main Sep 4, 2023
@shellscape
Copy link
Copy Markdown

hey folks, apologies for this kind of question, but I'm unfamiliar with the release scheduling for Vite and I wasn't able to dig up (or missed) the docs around it. Is there any info that outlines when we could expect to see this released?

@bluwy
Copy link
Copy Markdown
Member

bluwy commented Sep 8, 2023

We haven't made a release this week. I'll skim through some PRs to merge and cut a new release today. The next version should be 5.0.0-beta.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

p2-nice-to-have Not breaking anything but nice to have (priority)

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

5 participants