Skip to content

Commit

Permalink
Merge 60da73a into 6693dcc
Browse files Browse the repository at this point in the history
  • Loading branch information
tobySolutions committed Apr 18, 2024
2 parents 6693dcc + 60da73a commit a612f61
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
9 changes: 4 additions & 5 deletions website/pages/docs/automatic.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ Automatic mode provides customization options:
- `threshold`: What is used to determine whether a component should be converted to Million.js.
When the threshold increases, fewer components will be optimized, and vice versa.
- `skip`: An array of identifiers to indicate if a component should be skipped. You can add hook or variable names, function names, etc.
- `rsc`: If you're using React Server Components, set this to `true` to enable RSC support.

The `auto` object lets you configure options beyond the default ones set during installation:

```js
auto: {
threshold: 0.05, // default: 0.1,
skip: ['useBadHook', /badVariable/g], // default []
}
skip: ["useBadHook", /badVariable/g], // default []
rsc: true, // default value is false
};
```

<Tabs items={['Next.js', 'Astro', 'Gatsby', 'Vite', 'Remix', 'Create React App', 'Webpack', 'Rollup']} storageKey="selected-bundler-compiler">
Expand Down Expand Up @@ -202,6 +204,3 @@ function App() {
}
````

### Muting help messages

To avoid seeing help messages, you can pass the `mute: true{:js}` option to the compiler inside the `auto` object.
14 changes: 14 additions & 0 deletions website/pages/docs/install.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: 'How to install Million.js into your React project'

import { Callout, Tabs, Tab, Steps } from 'nextra-theme-docs';


# Installation

Million.js assumes that you have an existing React project. To learn about how to create a React app, please see [React's documentation](https://react.dev).
Expand Down Expand Up @@ -355,3 +356,16 @@ export default {
</Tab>

</Tabs>

## Try it Out

If you just want to see Million or [Million Lint](/blog/lint) in action, check out the below code templates that have been curated to help figure out how to set it up in any stack

- __Nextjs App Router__: [App Router Demo](https://github.com/tobySolutions/million-app-router-demo)
- __Nextjs Pages Router__: [Pages Router Demo](https://github.com/tobySolutions/million-pages-router)
- __Vite__: [Vite Demo](https://github.com/tobySolutions/million-vite-demo)
- __Remix__: [Remix Demo](https://github.com/tobySolutions/million-remix-demo)
- __Astro__: [Astro Demo](https://github.com/tobySolutions/millionjs-astro-demo)
- __Gatsby__: [Gatsby Demo](https://github.com/tobySolutions/million-gatsby-demo)
- __Craco__: [Craco Demo](https://github.com/tobySolutions/millionjs-craco-demo)
- __Webpack__: [Webpack Demo](https://github.com/tobySolutions/million-react-webpack)
2 changes: 1 addition & 1 deletion website/pages/docs/manual-mode/block.en-US.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ import { block } from 'million/react'; // ✅ Correct
</code>
</Callout>

You may have forgot to use the compiler, a necessary part in ensuring that your JSX is compiled to Million.js compatible code. You can view the instructions at [the installation guide](/docs/getting-started/install).
You may have forgot to use the compiler, a necessary part in ensuring that your JSX is compiled to Million.js compatible code. You can view the instructions at [the installation guide](/docs/install).

On a side note, Million.js is technically usable without the compiler, but it's significantly more limited in scope, and there is a more limited set of features available. This is not recommended.

Expand Down

0 comments on commit a612f61

Please sign in to comment.