Skip to content

Commit

Permalink
Merge branch 'main' into docs/social-image-big-card
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Mar 9, 2024
2 parents 86b052d + 5ad26f7 commit 4d452d6
Show file tree
Hide file tree
Showing 16 changed files with 167 additions and 177 deletions.
20 changes: 10 additions & 10 deletions examples/basic-vue/build.js
@@ -1,18 +1,18 @@
// https://github.com/tinylibs/tinybench
import path from 'node:path'
import url from 'node:url'
import { performance } from 'node:perf_hooks'
import * as rolldown from '@rolldown/node'

const dirname = path.dirname(url.fileURLToPath(import.meta.url))
const start = performance.now()

const build = await rolldown.rolldown({
input: path.join(dirname, 'index.js'),
// @ts-ignore
cwd: dirname,
input: './index.js',
resolve: {
conditionNames: ['node', 'import'],
alias: {},
}
// This needs to be explicitly set for now because oxc resolver doesn't
// assume default exports conditions. Rolldown will ship with a default that
// aligns with Vite in the future.
conditionNames: ['import'],
},
})

await build.write()

console.log(`bundled in ${(performance.now() - start).toFixed(2)}ms`)
4 changes: 2 additions & 2 deletions examples/basic-vue/index.js
@@ -1,3 +1,3 @@
import * as vue from 'vue'
import { createApp } from 'vue'

export default vue
export default createApp({})
3 changes: 1 addition & 2 deletions examples/basic-vue/package.json
Expand Up @@ -6,8 +6,7 @@
"build": "node build.js"
},
"devDependencies": {
"@rolldown/node": "workspace:*",
"esbuild": "^0.19.5"
"@rolldown/node": "workspace:*"
},
"dependencies": {
"vue": "^3.4.21"
Expand Down
110 changes: 0 additions & 110 deletions examples/basic-vue/tsconfig.json

This file was deleted.

5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -32,6 +32,9 @@
"typecheck": "yarn workspace @rolldown/node run typecheck",
"bench": "yarn workspace bench run bench",
"build:ts": "tsc -b tsconfig.project.json",
"docs": "cd web/docs && yarn dev",
"docs:build": "cd web/docs && yarn build",
"docs:preview": "cd web/docs && yarn preview",
"TODO(hyf0): #need to investigate following commands": "_",
"build:ci:release": "run-s build:node:ci build:binding:release",
"build:node:ci": "yarn workspace @rolldown/node run build",
Expand Down Expand Up @@ -74,4 +77,4 @@
"engines": {
"node": ">=18.18.0"
}
}
}
13 changes: 13 additions & 0 deletions packages/bench/index.js
Expand Up @@ -28,6 +28,10 @@ const suites = [
title: 'threejs10x',
inputs: [path.join(repoRoot, './temp/three10x/entry.js')],
},
{
title: 'vue',
inputs: [path.join(dirname, 'vue-entry.js')],
},
{
title: 'react_and_react_dom',
inputs: ['react', 'react-dom'],
Expand All @@ -40,6 +44,15 @@ const suites = [
async function runRolldown(item) {
const build = await rolldown.rolldown({
input: item.inputs,
resolve: {
// TODO
// For now these are needed to align better w/ esbuild & Vite behavior
// because internally we are still using the default behavior of oxc
// resovler. We should ship a more sensible resolver default that aligns
// with Vite's.
conditionNames: ['import'],
mainFields: ['module', 'browser', 'main'],
},
})
await build.write({
dir: path.join(dirname, `./dist/rolldown/${item.title}`),
Expand Down
4 changes: 3 additions & 1 deletion packages/bench/package.json
Expand Up @@ -12,6 +12,8 @@
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tinybench": "^2.5.1"
"tinybench": "^2.5.1",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
}
}
10 changes: 10 additions & 0 deletions packages/bench/vue-entry.js
@@ -0,0 +1,10 @@
import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
history: createWebHistory(),
})
const app = createApp({})

app.use(router)
app.mount('#app')
2 changes: 1 addition & 1 deletion packages/node/package.json
Expand Up @@ -37,4 +37,4 @@
"unbuild": "^2.0.0",
"vitest": "^0.34.6"
}
}
}
2 changes: 1 addition & 1 deletion packages/node/src/options/input-options.ts
Expand Up @@ -16,7 +16,7 @@ export interface InputOptions {
}

export type RolldownResolveOptions = Omit<ResolveOptions, 'alias'> & {
alias: Record<string, string>
alias?: Record<string, string>
}

export type RolldownNormalizedInputOptions = NormalizedInputOptions & {
Expand Down
33 changes: 29 additions & 4 deletions web/docs/.vitepress/config.ts
Expand Up @@ -16,6 +16,7 @@ export default defineConfig({
['meta', { property: 'og:type', content: 'website' }],
['meta', { property: 'og:locale', content: 'en' }],
['meta', { property: 'og:title', content: 'Rolldown | Rust bundler for JavaScript' }],
['meta', { property: 'og:image', content: 'https://rolldown.rs/og-image.png' }],
['meta', { property: 'og:site_name', content: 'Rolldown' }],
['meta', { property: 'og:url', content: 'https://rolldown.rs/' }],
['meta', { name: 'twitter:card', content: 'summary_large_image' }],
Expand All @@ -27,12 +28,35 @@ export default defineConfig({

// https://vitepress.dev/reference/default-theme-config
nav: [
{ text: 'Home', link: '/' },
{ text: 'About', link: '/about.md' },
{
text: 'About',
link: '/about.md',
},
{ text: 'Contribute', link: '/contrib-guide/' },
{
text: 'Roadmap',
link: 'https://github.com/rolldown-rs/rolldown/discussions/153',
text: 'Resources',
items: [
{
text: 'Team',
link: '/team.md',
},
{
text: 'Roadmap',
link: 'https://github.com/rolldown-rs/rolldown/discussions/153',
},
{
items: [
{
text: 'Twitter',
link: 'https://twitter.com/rolldown_rs',
},
{
text: 'Discord Chat',
link: 'https://discord.gg/vsZxvsfgC5',
},
],
},
],
},
],

Expand All @@ -43,6 +67,7 @@ export default defineConfig({
{ text: 'Build', link: '/contrib-guide/build.md' },
{ text: 'Test', link: '/contrib-guide/test.md' },
{ text: 'Benchmark', link: '/contrib-guide/benchmark.md' },
{ text: 'Docs', link: '/contrib-guide/docs.md' },
{ text: 'Release', link: '/contrib-guide/release.md' },
],
},
Expand Down
44 changes: 0 additions & 44 deletions web/docs/about.md
@@ -1,41 +1,3 @@
<script setup>
import { VPTeamMembers } from 'vitepress/theme'

const members = [
{
avatar: 'https://www.github.com/yyx990803.png',
name: 'Evan You',
links: [
{ icon: 'github', link: 'https://github.com/yyx990803' },
{ icon: 'twitter', link: 'https://twitter.com/youyuxi' }
]
},
{
avatar: 'https://www.github.com/Brooooooklyn.png',
name: 'Yinan Long (Brooooooklyn)',
links: [
{ icon: 'github', link: 'https://github.com/Brooooooklyn' },
{ icon: 'twitter', link: 'https://twitter.com/Brooooook_lyn' }
]
},
{
avatar: 'https://www.github.com/hyf0.png',
name: 'Yunfei He',
links: [
{ icon: 'github', link: 'https://github.com/hyf0' },
{ icon: 'twitter', link: 'https://twitter.com/_hyf0' }
]
},
{
avatar: 'https://www.github.com/underfin.png',
name: 'Kui Li (underfin)',
links: [
{ icon: 'github', link: 'https://github.com/underfin' }
]
}
]
</script>

# About Rolldown

## TL;DR
Expand Down Expand Up @@ -99,9 +61,3 @@ Rolldown is still in early stage. We have a lot of ground to cover, and we won't
- [GitHub](https://github.com/rolldown-rs/rolldown)
- [Contribution Guide](/contrib-guide/)
- [Discord Chat](https://discord.gg/vsZxvsfgC5)

### The Team

The Rolldown project was originally created by [Yinan Long](https://github.com/Brooooooklyn) (aka Brooooooklyn, author of [NAPI-RS](https://napi.rs/)), and is now led by [Evan You](https://github.com/yyx990803) (creator of [Vite](https://vitejs.dev/)).

<VPTeamMembers size="small" :members="members" />
20 changes: 20 additions & 0 deletions web/docs/contrib-guide/docs.md
@@ -0,0 +1,20 @@
# Docs

Rolldown is documented using [VitePress](https://vitepress.dev). You can find the source code for the site in `web/docs`. Check out the [Markdown Extensions Guide](https://vitepress.dev/guide/markdown) to learn about VitePress features.

To contribute to the documentation, you can start the docs dev server running on the project root:

```
yarn docs
```

You can then edit the markdown files and see your changes instantly. The docs structure is configured at `web/docs/.vitepress/config.ts` (see the [Site Config Reference](https://vitepress.dev/reference/site-config)).

If you'd like to review the built site, run in the project root:

```
yarn docs:build
yarn docs:preview
```

This step isn't needed when contributing if you aren't modifying the docs build setup.
Binary file added web/docs/public/og-image.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4d452d6

Please sign in to comment.