Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

single-pool: update docs with examples #5414

Merged
merged 7 commits into from
Nov 9, 2023

Conversation

2501babe
Copy link
Contributor

@2501babe 2501babe commented Oct 3, 2023

No description provided.

@2501babe
Copy link
Contributor Author

2501babe commented Oct 3, 2023

well this is driving me crazy...

as-is, this block:

const transaction = await SinglePoolProgram.deposit({
  connection,
  pool: poolAddress,
  userWallet,
  userStakeAccount,
});

// sign with the fee payer and stake account withdraw authority, if these signers differ
// userWallet is a convenience parameter to use one account as a payer, authority, and lamport recipient

produces this error:

SyntaxError: /home/hana/work/solana/spl/docs/src/single-pool.mdx: Unexpected token, expected "}" (240:6)
  238 | const transaction = await SinglePoolProgram.deposit({
  239 |   connection,
> 240 |   pool: poolAddress,
      |       ^
  241 |   userWallet,
  242 |   userStakeAccount,
  243 | });
[ERROR] Client bundle compiled with errors therefore further build is impossible.

at first i thought maybe it doesnt understand the js autofill thing (where you type a, for a: a, but its not that because replacing all of them with explicit colon syntax errors on the first colon. deleting the line with the colon instead produces this:

SyntaxError: /home/hana/work/solana/spl/docs/src/single-pool.mdx: Unexpected token (242:0)
  240 |   userWallet,
  241 |   userStakeAccount,
> 242 | });
      | ^
  243 | <p>{`// sign with the fee payer and stake account withdraw authority, if these signers differ
  244 | // userWallet is a convenience parameter to use one account as a payer, authority, and lamport recipient`}</p>
  245 | <pre><code parentName="pre" {...{}}>{`  </TabItem>
[ERROR] Client bundle compiled with errors therefore further build is impossible.

the only things i can think of is i have a syntax error somewhere (im 100% sure there are no mismatched brackets anywhere in the file because i can use my editor to check for them, and 90% sure there are no mismatched backticks) or the docusaurus parser is broken in some way...?

@joncinque you wouldnt happen to have any insight would you...

@2501babe
Copy link
Contributor Author

2501babe commented Oct 3, 2023

something extremely strange is happening because if i put const x = {a: 1}; into that typescript block, it gives me the error, but if it put it in any prior typescript block, its fine, and the error shows up at pool: poolAddress, like normal. im reduced to deleting random things in between to see if theres some mismatched... anything?

@2501babe
Copy link
Contributor Author

2501babe commented Oct 3, 2023

ok this is 100% a parser bug in docusaurus because the error moves from x to transaction in this:

const x = {a: 1}; 
const transaction = await SinglePoolProgram.deposit({
  connection,
  pool: poolAddress,
  userWallet,
  userStakeAccount,
});

when i add a newline between <TabItem value="jsc" label="WEB3.JS CLASSIC"> and ```typescript

@2501babe
Copy link
Contributor Author

2501babe commented Oct 3, 2023

i fixed it by adding tons of newlines to the file and i am now a supporter of any totalitarian regime that would force all web programmers to take an intro-level computational linguistics course

@2501babe 2501babe marked this pull request as ready for review October 3, 2023 12:28
@2501babe 2501babe requested a review from joncinque October 3, 2023 12:28
@2501babe
Copy link
Contributor Author

2501babe commented Oct 3, 2023

im ready for review with the caveat that i need to fill in whatever the npm package name will be where it says XXX TODO

Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great overall! Just a few small comments, but this will be great to get people started

docs/src/single-pool.mdx Outdated Show resolved Hide resolved
docs/src/single-pool.mdx Outdated Show resolved Hide resolved
docs/src/single-pool.mdx Outdated Show resolved Hide resolved
docs/src/single-pool.mdx Outdated Show resolved Hide resolved
docs/src/single-pool.mdx Outdated Show resolved Hide resolved
docs/src/single-pool.mdx Outdated Show resolved Hide resolved
docs/src/single-pool.mdx Outdated Show resolved Hide resolved
@2501babe
Copy link
Contributor Author

2501babe commented Oct 6, 2023

alright merging after i have npm urls to add

@2501babe
Copy link
Contributor Author

latest commit per #5488

joncinque
joncinque previously approved these changes Oct 18, 2023
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me once the links are updated with the deployed packages.

@github-actions github-actions bot added the stale [bot only] Added to stale content; will be closed soon label Nov 2, 2023
@github-actions github-actions bot closed this Nov 9, 2023
@joncinque joncinque reopened this Nov 9, 2023
@joncinque
Copy link
Contributor

I'm pretty sure we still want this, right?

@2501babe
Copy link
Contributor Author

2501babe commented Nov 9, 2023

yes i just needed to finally get the js on npm, which is now done!

@mergify mergify bot dismissed joncinque’s stale review November 9, 2023 13:41

Pull request has been modified.

@2501babe 2501babe removed the stale [bot only] Added to stale content; will be closed soon label Nov 9, 2023
@2501babe 2501babe merged commit 80adefd into solana-labs:master Nov 9, 2023
4 checks passed
@2501babe 2501babe deleted the 20231001_svspdocs branch November 9, 2023 14:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants