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

docs: fix typo #9855

Merged
merged 5 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/plugin-react/src/jsx-runtime/babel-restore-jsx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export default function (

/**
* Get a JSXIdentifier or JSXMemberExpression from a Node of known type.
* Returns null if a unknown node type, null or undefined is passed.
* Returns null if an unknown node type, null or undefined is passed.
*/
function getJSXName(node: any): any {
if (node == null) {
Expand All @@ -100,7 +100,7 @@ export default function (
}

/**
* Get a array of JSX(Spread)Attribute from a props ObjectExpression.
* Get an array of JSX(Spread)Attribute from a props ObjectExpression.
* Handles the _extends Expression babel creates from SpreadElement nodes.
* Returns null if a validation error occurs.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export async function transformMain(
if (options.sourceMap) {
if (scriptMap && templateMap) {
// if the template is inlined into the main module (indicated by the presence
// of templateMap, we need to concatenate the two source maps.
// of templateMap), we need to concatenate the two source maps.

const gen = fromMap(
// version property of result.map is declared as string
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/src/node/plugins/resolve.ts
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ function tryFsResolve(

let res: string | undefined

// if we fould postfix exist, we should first try resolving file with postfix. details see #4703.
// if we found postfix exist, we should first try resolving file with postfix. details see #4703.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// if we found postfix exist, we should first try resolving file with postfix. details see #4703.
// if a postfix exists, we should first try resolving file with postfix. details see #4703.

if (
postfix &&
(res = tryResolveFile(
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/plugins/worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface WorkerCache {
// save worker all emit chunk avoid rollup make the same asset unique.
assets: Map<string, EmittedAsset>

// worker bundle don't deps on any more worker runtime info an id only had an result.
// worker bundle don't deps on any more worker runtime info an id only had a result.
// save worker bundled file id to avoid repeated execution of bundles
// <input_filename, fileName>
bundle: Map<string, string>
Expand Down Expand Up @@ -217,7 +217,7 @@ export function webWorkerPlugin(config: ResolvedConfig): Plugin {
const ssr = options?.ssr === true
const query = parseRequest(id)
if (query && query[WORKER_FILE_ID] != null) {
// if import worker by worker constructor will had query.type
// if import worker by worker constructor will have query.type
// other type will be import worker by esm
const workerType = query['type']! as WorkerType
let injectEnv = ''
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/server/middlewares/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ export function baseMiddleware({
// Keep the named function. The name is visible in debug logs via `DEBUG=connect:dispatcher ...`
return function viteBaseMiddleware(req, res, next) {
const url = req.url!
const parsed = new URL(url, 'http://vitejs.dev')
const parsed = new URL(url, 'https://vitejs.dev')
bluwy marked this conversation as resolved.
Show resolved Hide resolved
const path = parsed.pathname || '/'

if (path.startsWith(devBase)) {
// rewrite url to remove base.. this ensures that other middleware does
// rewrite url to remove base. this ensures that other middleware does
// not need to consider base being prepended or not
req.url = url.replace(devBase, '/')
return next()
Expand Down
4 changes: 2 additions & 2 deletions packages/vite/src/node/server/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface WebSocketServer {
*/
clients: Set<WebSocketClient>
/**
* Boardcast events to all clients
* Broadcast events to all clients
*/
send(payload: HMRPayload): void
/**
Expand Down Expand Up @@ -108,7 +108,7 @@ export function createWebSocketServer(
const port = hmrPort || 24678
const host = (hmr && hmr.host) || undefined
if (httpsOptions) {
// if we're serving the middlewares over https, the ws library doesn't support automatically creating an https server, so we need to do it ourselves
// if we're serving the middlewares over https, the ws library doesn't support automatically creating a https server, so we need to do it ourselves
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// if we're serving the middlewares over https, the ws library doesn't support automatically creating a https server, so we need to do it ourselves
// if we're serving the middlewares over https, the ws library doesn't support automatically creating an https server, so we need to do it ourselves

The original text is correct. Use an before an unsounded h.

// create an inline https server and mount the websocket server to it
httpsServer = createHttpsServer(httpsOptions, (req, res) => {
const statusCode = 426
Expand Down
2 changes: 1 addition & 1 deletion packages/vite/types/chokidar.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export interface WatchOptions {
ignorePermissionErrors?: boolean

/**
* `true` if `useFsEvents` and `usePolling` are `false`). Automatically filters out artifacts
* `true` if `useFsEvents` and `usePolling` are `false`. Automatically filters out artifacts
* that occur when using editors that use "atomic writes" instead of writing directly to the
* source file. If a file is re-added within 100 ms of being deleted, Chokidar emits a `change`
* event rather than `unlink` then `add`. If the default of 100 ms does not work well for you,
Expand Down
2 changes: 1 addition & 1 deletion playground/resolve/__tests__/resolve.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ test('deep import with exports field', async () => {
})

test('deep import with query with exports field', async () => {
// since it is imported with `?url` it should return a url
// since it is imported with `?url` it should return an url
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// since it is imported with `?url` it should return an url
// since it is imported with `?url` it should return a URL

Similar to issue above with the unsounded h, use a before a sounded u.

expect(await page.textContent('.exports-deep-query')).toMatch(
isBuild ? /base64/ : '/exports-path/deep.json'
)
Expand Down
2 changes: 1 addition & 1 deletion playground/vue/PreProcessors.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
h2.pre-processors Pre-Processors
p.pug
| This is rendered from &lt;template lang="pug"&gt;
| and styled with &lt;style lang="sass"&gt;. It should be megenta.
| and styled with &lt;style lang="sass"&gt;. It should be magenta.
p.pug-less
| This is rendered from &lt;template lang="pug"&gt;
| and styled with &lt;style lang="less"&gt;. It should be green.
Expand Down
2 changes: 1 addition & 1 deletion playground/wasm/vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { defineConfig } from 'vite'
export default defineConfig({
build: {
// make can no emit light.wasm
// make can not emit light.wasm
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// make can not emit light.wasm
// make cannot emit light.wasm

// and emit add.wasm
assetsInlineLimit: 80
}
Expand Down