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

chore: add jsdoc default value #11746

Merged
merged 2 commits into from Feb 14, 2023
Merged

chore: add jsdoc default value #11746

merged 2 commits into from Feb 14, 2023

Conversation

chenfan0
Copy link
Contributor

Description

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.

@chenfan0 chenfan0 force-pushed the chore/default branch 3 times, most recently from 9b913c3 to 6581113 Compare January 19, 2023 06:49
@@ -122,6 +123,7 @@ export interface BuildOptions {
* a niche browser that comes with most modern JavaScript features
* but has poor CSS support, e.g. Android WeChat WebView, which
* doesn't support the #RGBA syntax.
* @default target
Copy link
Member

Choose a reason for hiding this comment

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

If this defaults to target, what is the default when target = 'modules'?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

when target === 'modules', vite will replace 'modules' to ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14'], so the css target also is ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']

@@ -75,6 +75,7 @@ export interface BuildOptions {
*
* For custom targets, see https://esbuild.github.io/api/#target and
* https://esbuild.github.io/content-types/#javascript for more details.
* @default ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']
Copy link
Member

Choose a reason for hiding this comment

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

These values are not under our control I assume? So when esbuild changes them, our docs are stale, are they?
Maybe forward to their docs (like we did already in the description above)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in the docs, the build.target default is 'modules', but when build.target === 'module' vite will replace modules to ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']. So i think the real default is ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14']

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think theIDE tooltips show 'modules' is more friendly, althought the real default is ['es2020', 'edge88', 'firefox78', 'chrome87', 'safari14'].

@@ -152,7 +153,7 @@ export interface FileSystemServeOptions {
* This will have higher priority than `allow`.
* picomatch patterns are supported.
*
* @default ['.env', '.env.*', '*.crt', '*.pem']
* @default ['.env', '.env.*', '*.\{crt,pem\}']
Copy link
Member

Choose a reason for hiding this comment

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

I might be wrong, but I think this was done because \ get rendered in IDE tooltips directly instead of working as escaping char, so pls revert this

@@ -11,7 +11,7 @@ export interface SSROptions {
/**
* Define the target for the ssr build. The browser field in package.json
* is ignored for node but used if webworker is the target
* Default: 'node'
* @default 'node''
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @default 'node''
* @default 'node'

@@ -20,6 +20,7 @@ export interface SSROptions {
* left marked as experimental to give users more time to update to ESM. CJS builds requires
* complex externalization heuristics that aren't present in the ESM format.
* @experimental
* @default 'esm''
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* @default 'esm''
* @default 'esm'

bluwy
bluwy previously approved these changes Feb 14, 2023
@bluwy bluwy enabled auto-merge (squash) February 14, 2023 10:08
@bluwy bluwy merged commit 8c87af7 into vitejs:main Feb 14, 2023
futurGH pushed a commit to futurGH/vite that referenced this pull request Feb 26, 2023
@chenfan0 chenfan0 deleted the chore/default branch June 21, 2023 09:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants