Skip to content

Rewrite website in Vitepress and merge it into the main repository#4807

Merged
lukastaegert merged 44 commits into
masterfrom
vitepress
Jan 20, 2023
Merged

Rewrite website in Vitepress and merge it into the main repository#4807
lukastaegert merged 44 commits into
masterfrom
vitepress

Conversation

@lukastaegert

@lukastaegert lukastaegert commented Jan 18, 2023

Copy link
Copy Markdown
Member

This PR contains:

  • bugfix
  • feature
  • refactor
  • documentation
  • other

Are tests included?

  • yes (bugfixes and features will not be merged without tests)
  • no

Breaking Changes?

  • yes (breaking changes will not be merged unless absolutely necessary)
  • no

List any relevant issue numbers:

Description

It has been a long-standing wish of mine to merge the website into the main repository to make it much easier to update documentation and directly preview the results. At the same time people were noting that the website looked dated, and if we would not want to use a more professional base like vitepress, which would also bring many subtle improvements like dark mode etc.
There was an original PoC by discord user khr2003 https://discord.com/channels/466787075518365708/650925402168098847/985800336486850600 on which my current implementation is based, thank you for that!

This PR will bring many improvements:

  • Having the website together with the documentation makes it easy for anyone to preview documentation updates locally
  • And not only that, we can also have a deployed preview version in each pull request with documentation updates
  • Vitepress brings fast and reliable HMR to documentation development
  • I used the opportunity to break the website into a couple of smaller pages based on the current markdown files, which is also a point some people noted as possible improvement
  • I already completely rewrote the REPL in Vue.
  • And not only that. As Vite uses the Rollup plugin system and Rollup is bundled via Rollup, I was able to make the REPL by default use a version of the Rollup browser build that is created ad-hoc by Vite! Yes, we have come full circle and Rollup now uses Vite, in a way 😉. And you get full HMR as well: If you have the development REPL open in a browser and change something in the Rollup sources, the REPL will automatically rebundle the currently shown example without reload. Which is much faster than a classic rebuild of Rollup. So this might really come in handy when working on some tree-shaking feature or a bug that can be reproduced in the REPL for quick iterations.
  • For that reason, npm run dev will now start Vitepress as "the" development tool. Just remember to turn your code into a proper test afterwards.
  • You can still use any other Rollup version locally by editing the URL (in the future, maybe someone finds time to add a proper version picker?). There is also a subtle Version information in the REPL. Note the new design that I tried to bring as close to the styling of the new guide as possible. For PRs, this line will contain a highlighted link to the PR on GitHub. For regular builds, it will contain a link to the release notes on GitHub.
    repl-version
  • And of course we now have dark mode
    dark-mode
  • I also thought about some nice key features to mention on the home page that set Rollup apart from other bundlers and define what it is all about. Feedback welcome! Note that I boldly put Vite in here as well as I really see Vite as the development setup and server for Rollup that had been missing for a long time. So people looking for a more no-config streamlined experience are guided to the right place.
    home-page
  • On build, the Vitepress setup will now verify all anchor targets are found so that there should be no dead links in the website.
  • Legacy links still work as well! I added a table that maps old url hashes to new locations so that all old /guide/en#something will work and forward you to the correct new page. So e.g. going to /guide/en/#thisload will automatically forward you to /plugin-development/#this-load.

Remaining TODOs

  • Add favicon + social sharing options
  • Update CONTRIBUTING.md with proper instructions and explanations
  • See if we can update the auto-generated PR comment to include use a preview of the new website
  • Add Stackblitz config to start the Vitepress-based website when opening Rollup
  • Ensure all links in Rollup's sources are verified as well by extracting them into e.g. a JSON file.
  • Verify all links in mermaid scripts and on the home page automatically.
  • Change deployment to replace rollupjs.org (after merge to master possibly)

@netlify

netlify Bot commented Jan 18, 2023

Copy link
Copy Markdown

Deploy Preview for remarkable-travesseiro-a49bb0 ready!

Name Link
🔨 Latest commit 3478cfc
🔍 Latest deploy log https://app.netlify.com/sites/remarkable-travesseiro-a49bb0/deploys/63ca98241ddb2c0008feaea8
😎 Deploy Preview https://deploy-preview-4807--remarkable-travesseiro-a49bb0.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions

github-actions Bot commented Jan 18, 2023

Copy link
Copy Markdown

Thank you for your contribution! ❤️

You can try out this pull request locally by installing Rollup via

npm install rollup/rollup#vitepress

or load it into the REPL:
https://deploy-preview-4807--rollupjs.netlify.app/repl/?pr=4807

@lukastaegert

Copy link
Copy Markdown
Member Author

As you can see, Netlify is already hard at work to provide you with deployment previews to inspect 😉

@codecov

codecov Bot commented Jan 18, 2023

Copy link
Copy Markdown

Codecov Report

Merging #4807 (6e01bba) into master (635e2b9) will decrease coverage by 0.01%.
The diff coverage is 94.44%.

❗ Current head 6e01bba differs from pull request most recent head 9d693ee. Consider uploading reports for the commit 9d693ee to get more accurate results

@@            Coverage Diff             @@
##           master    #4807      +/-   ##
==========================================
- Coverage   98.99%   98.98%   -0.01%     
==========================================
  Files         218      219       +1     
  Lines        7790     7814      +24     
  Branches     2166     2166              
==========================================
+ Hits         7712     7735      +23     
- Misses         25       26       +1     
  Partials       53       53              
Impacted Files Coverage Δ
src/Bundle.ts 100.00% <ø> (ø)
src/utils/collapseSourcemaps.ts 90.42% <0.00%> (ø)
src/utils/error.ts 98.95% <0.00%> (-0.52%) ⬇️
src/utils/options/mergeOptions.ts 100.00% <ø> (ø)
src/utils/options/normalizeInputOptions.ts 100.00% <ø> (ø)
src/watch/watch-proxy.ts 100.00% <ø> (ø)
cli/run/batchWarnings.ts 98.34% <100.00%> (ø)
src/utils/options/normalizeOutputOptions.ts 100.00% <100.00%> (ø)
src/utils/options/options.ts 100.00% <100.00%> (ø)
src/utils/url.ts 100.00% <100.00%> (ø)
... and 1 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@lukastaegert lukastaegert force-pushed the vitepress branch 5 times, most recently from efa9f2d to 9ee2ee1 Compare January 20, 2023 16:08
@lukastaegert lukastaegert merged commit 52fc969 into master Jan 20, 2023
@lukastaegert lukastaegert deleted the vitepress branch January 20, 2023 19:54
@rollup-bot

Copy link
Copy Markdown
Collaborator

This PR has been released as part of rollup@3.11.0. You can test it via npm install rollup.

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.

2 participants