From 453c0d95deaf6414d4f04fd781f0ef3b2b5a170e Mon Sep 17 00:00:00 2001 From: armaniferrante Date: Sat, 2 Jan 2021 18:45:51 -0800 Subject: [PATCH] Dehydrate docs to fix SSR issue --- docs/package.json | 7 ++++--- docs/src/.vuepress/config.js | 6 +++++- docs/src/getting-started/introduction.md | 2 +- docs/yarn.lock | 7 +++++++ examples/basic/src/lib.rs | 2 -- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/docs/package.json b/docs/package.json index b4636e17f..23f9cac26 100755 --- a/docs/package.json +++ b/docs/package.json @@ -8,14 +8,15 @@ "email": "" }, "repository": "/anchor", - "scripts": { - "deploy": "yarn build && gh-pages -d src/.vuepress/dist", + "scripts": { + "deploy": "yarn build && gh-pages -d src/.vuepress/dist", "dev": "vuepress dev src", "build": "vuepress build src" }, "license": "MIT", "devDependencies": { "gh-pages": "^3.1.0", - "vuepress": "^1.5.3" + "vuepress": "^1.5.3", + "vuepress-plugin-dehydrate": "^1.1.5" } } diff --git a/docs/src/.vuepress/config.js b/docs/src/.vuepress/config.js index 0dad812b6..e15a1a54b 100755 --- a/docs/src/.vuepress/config.js +++ b/docs/src/.vuepress/config.js @@ -58,5 +58,9 @@ module.exports = { /** * Apply plugins,ref:https://v1.vuepress.vuejs.org/zh/plugin/ */ - plugins: ["@vuepress/plugin-back-to-top", "@vuepress/plugin-medium-zoom"], + plugins: [ + "dehydrate", + "@vuepress/plugin-back-to-top", + "@vuepress/plugin-medium-zoom", + ], }; diff --git a/docs/src/getting-started/introduction.md b/docs/src/getting-started/introduction.md index 83466847a..b8cdb5df2 100644 --- a/docs/src/getting-started/introduction.md +++ b/docs/src/getting-started/introduction.md @@ -8,7 +8,7 @@ Anchor is a framework for Solana's [Sealevel](https://medium.com/solana-labs/sea If you're familiar with developing in Ethereum's [Solidity](https://docs.soliditylang.org/en/v0.7.4/) and [web3.js](https://github.com/ethereum/web3.js) or Parity's [Ink!](https://github.com/paritytech/ink), then the experience will be familiar. Although the DSL syntax and semantics are targeted at Solana, the high level flow of writing RPC request handlers, emitting an IDL, and generating clients from IDL is the same. -Here, we'll walkthrough a tutorial demonstrating how to use Anchor. To skip the tutorial and jump straight to a full example, go [here](https://github.com/project-serum/anchor/tree/master/examples/basic). +Here, we'll walkthrough a tutorial demonstrating how to use Anchor. To skip the tutorial and jump straight to a full example, go [here](https://github.com/project-serum/anchor/tree/master/examples/basic/src/lib.rs). ## Contributing diff --git a/docs/yarn.lock b/docs/yarn.lock index f46abfcd3..61a03f260 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -7674,6 +7674,13 @@ vuepress-plugin-container@^2.0.2: "@vuepress/shared-utils" "^1.2.0" markdown-it-container "^2.0.0" +vuepress-plugin-dehydrate@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/vuepress-plugin-dehydrate/-/vuepress-plugin-dehydrate-1.1.5.tgz#c29f08b85f337d3bc7c0ba09fe58cd9ed2f6e6c1" + integrity sha512-9F2x1vLCK4poPUMkLupD4HsgWdbZ68Escvma+DE1Dk6aAJdH5FGwmfOMxj4sMCBwz7S4s6bTMna+QQgD3+bzBA== + dependencies: + "@vuepress/shared-utils" "^1.2.0" + vuepress-plugin-smooth-scroll@^0.0.3: version "0.0.3" resolved "https://registry.yarnpkg.com/vuepress-plugin-smooth-scroll/-/vuepress-plugin-smooth-scroll-0.0.3.tgz#6eff2d4c186cca917cc9f7df2b0af7de7c8c6438" diff --git a/examples/basic/src/lib.rs b/examples/basic/src/lib.rs index f92cac754..47950551d 100644 --- a/examples/basic/src/lib.rs +++ b/examples/basic/src/lib.rs @@ -4,7 +4,6 @@ use anchor::prelude::*; // Define the program's RPC handlers. -// #region program #[program] mod example { use super::*; @@ -46,7 +45,6 @@ mod example { Ok(()) } } -// #endregion program // Define the validated accounts for each handler.