-
-
Notifications
You must be signed in to change notification settings - Fork 584
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
307 additions
and
150 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,25 @@ | ||
{ | ||
"-- Getting Started": { | ||
"type": "separator", | ||
"title": "Getting Started" | ||
}, | ||
"index": "Introduction", | ||
"install": "Installation", | ||
"quickstart": "Tutorial", | ||
"faq": "FAQ", | ||
"automatic": "Automatic Mode", | ||
"-- API Reference": { | ||
"type": "separator", | ||
"title": "API Reference" | ||
}, | ||
"block": "block()", | ||
"for": "<For>", | ||
"-- Advanced": { | ||
"-- Guide": { | ||
"type": "separator", | ||
"title": "Advanced" | ||
"title": "Guide" | ||
}, | ||
"quickstart": "Tutorial", | ||
"rules": "Rules of Blocks", | ||
"typescript": "Usage with TypeScript", | ||
"virtualization": "Virtualization", | ||
"common-errors": "Common Errors", | ||
"typescript": "Usage with TypeScript", | ||
"internals": "Internals" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: 'Automatic Mode' | ||
description: 'The default mode of Million.js' | ||
--- | ||
|
||
import { Callout, Tabs, Tab, Steps } from 'nextra-theme-docs'; | ||
|
||
# Automatic Mode | ||
|
||
Automatic mode is the default mode of Million.js. It automatically converts React components to Million.js components. | ||
|
||
### Ignoring components | ||
|
||
If a certain component conflicts with the Million.js runtime, it's possible to skip over them via the `// million-ignore` comment. | ||
|
||
```js | ||
// million-ignore | ||
function App() { | ||
return ... | ||
} | ||
``` | ||
|
||
### Advanced customization | ||
|
||
Automatic mode provides options to tune automatic mode: | ||
|
||
- `threshold`: The threshold for the heuristic to determine whether a component should be converted to Million.js. The greater the threshold, fewer components will be optimized, and vice versa. The default is `0.1`. | ||
- `skip`: An array of identifiers that indicate a component should be skipped. You can put hook names, variable names, etc. The default is `[]`. | ||
|
||
|
||
```js | ||
const options = { | ||
auto: { | ||
threshold: 0.25, // default: 0.1, | ||
skip: ['useBadHook', /badVariable/g] // default [] | ||
} | ||
} | ||
``` | ||
|
||
### Muting help messages | ||
|
||
If you don't want to see the help messages, you can pass the `{ mute: true }{:js}` option to the compiler. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ff77a27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
million-kitchen-sink – ./packages/kitchen-sink
million-kitchen-sink-millionjs.vercel.app
million-kitchen-sink-git-main-millionjs.vercel.app
million-kitchen-sink.vercel.app
ff77a27
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
sink – ./packages/kitchen-sink
million-kitchen-sink-atit.vercel.app
sink-git-main-millionjs.vercel.app
sink-millionjs.vercel.app
sink.million.dev