Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs/blog api img #3249

Merged
merged 9 commits into from
Oct 8, 2024
Merged

Docs/blog api img #3249

merged 9 commits into from
Oct 8, 2024

Conversation

lawsonkight
Copy link
Collaborator

@lawsonkight lawsonkight commented Oct 8, 2024

Initial .png for REST API blog post.

Future improvements:

  • Convert to .svg to enable light mode version
  • Animated version

Summary by CodeRabbit

  • New Features

    • Launched the Synapse REST API, enabling developers to integrate with the Synapse Bridge for cross-chain transactions.
    • Introduced a technical blog with structured content on new features, API documentation, and developer resources.
  • Documentation

    • Added comprehensive guides for the REST API and a welcome post for the Synapse Technical Blog.
    • Updated author documentation to include Synapse Protocol Developers.
  • Configuration

    • Enhanced documentation and blog configuration for better navigation and content management.
  • Style

    • Expanded color customization options with new CSS variables.
    • Corrected sidebar label spelling from "Supported Rotues" to "Supported Routes."

15f58e1: docs preview link
ed66341: docs preview link

@lawsonkight lawsonkight requested a review from trajan0x as a code owner October 8, 2024 00:24
Copy link
Contributor

coderabbitai bot commented Oct 8, 2024

Walkthrough

This pull request introduces several new documentation files related to the Synapse REST API and blog enhancements. A new blog post details the API's launch, functionality, and key endpoints. Additionally, an entry for "Synapse Protocol Developers" is added to the authors' list. A welcome markdown file for the Synapse Technical Blog is created, outlining its purpose and content. Updates to the Docusaurus configuration enhance the blog's structure, while modifications to the homepage redirect users to a specific About page.

Changes

File Path Change Summary
docs/bridge/blog-posts/2024-10-10-rest-api-post.md New file introducing the Synapse REST API, its functionality, and key endpoints.
docs/bridge/blog-posts/authors.yml New entry for "Synapse Protocol Developers" added to the authors list.
docs/bridge/blog-posts/welcome.md New introductory post for the Synapse Technical Blog, outlining content and audience.
docs/bridge/docs/02-Bridge/05-Supported-Routes.md Sidebar label corrected from "Supported Rotues" to "Supported Routes."
docs/bridge/docs/02-Bridge/_05-Supported-Routes.md New file created with sidebar label "Supported Routes" detailing supported tokens.
docs/bridge/src/components/APIFlow.tsx New file introducing a React component that renders an SVG API flow diagram.
docs/bridge/src/css/custom.css New CSS variables added for enhanced color customization; width property of figure removed.
docs/bridge/docusaurus.config.ts Enhancements to Docusaurus configuration for blog features, including new paths and settings.

Possibly related PRs

  • REST API Migration #3049: The "REST API Migration" PR involves structural improvements and standardization of constants in the REST API, which aligns with the main PR's focus on enhancing the Synapse REST API documentation and functionality.
  • API method updates #3122: The "API method updates" PR introduces new API endpoints that enhance the functionality of the REST API, directly relating to the main PR's updates on the Synapse REST API.
  • REST API ReadME #3183: The "REST API ReadME" PR updates the README for the Synapse REST API, which is directly relevant to the main PR's documentation changes regarding the API.
  • Hide Routes component #3225: The "Hide Routes component" PR discusses the temporary removal of the <Routes /> component, which is relevant to the main PR's updates on the Synapse REST API and its documentation structure.
  • Add Routes Component [slt-317] #3226: The "Add Routes Component [slt-317]" PR reintroduces the <Routes /> component, which ties back to the main PR's focus on the Synapse REST API and its routing functionalities.

Suggested labels

size/xs, M-deps

Suggested reviewers

  • bigboydiamonds
  • abtestingalpha
  • trajan0x

Poem

🐰 In the meadow where knowledge grows,
A new API blooms, as everyone knows.
With paths to explore and endpoints to find,
The Synapse Bridge welcomes all kinds.
Join us in learning, let your code take flight,
In the world of Synapse, everything feels right! 🌟


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

cloudflare-workers-and-pages bot commented Oct 8, 2024

Deploying sanguine-fe with  Cloudflare Pages  Cloudflare Pages

Latest commit: c837def
Status: ✅  Deploy successful!
Preview URL: https://1a442ef4.sanguine-fe.pages.dev
Branch Preview URL: https://docs-blog-api-img.sanguine-fe.pages.dev

View logs

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (10)
docs/bridge/blog-posts/welcome.md (3)

9-14: LGTM! Consider enhancing the introduction.

The introduction effectively announces the Synapse Technical Blog and provides a clear overview of its purpose. The placement of the <!--truncate--> comment is correct for creating blog post previews.

To make the introduction more engaging, consider adding a brief sentence about why this blog is valuable to the reader. For example:

 On this blog, we will share insights, updates, and deep dives into our latest launches and developments from a developer's perspective. Here, you'll find detailed information about our newest features, APIs, and technical improvements that power Synapse Protocol.

+This blog will be your go-to resource for staying up-to-date with Synapse's technical advancements and maximizing your use of our protocol.

 <!--truncate-->
🧰 Tools
🪛 LanguageTool

[style] ~9-~9: Consider using a different adjective to strengthen your wording.
Context: ... [synapse] tags: [synapse] --- We are happy to announce the **Synapse Technical Blo...

(HAPPY_EXCITED)


37-45: LGTM! Consider adding an email subscription option.

The "Stay Connected" section effectively provides various channels for readers to engage with Synapse Protocol. The closing statement is positive and aligns well with the blog's purpose.

To further improve engagement, consider adding an option for readers to subscribe to the blog via email. This could be implemented as follows:

 - Follow us on [Twitter](https://twitter.com/synapseprotocol)
 - Join our [Discord](https://discord.gg/synapseprotocol)
 - Check out our [GitHub](https://github.com/synapsecns)
+- Subscribe to our newsletter (Add link or instructions for email subscription)

 We're excited to share our journey with you as we continue to innovate and improve the Synapse Protocol. Happy reading!

32-32: Add a comma after the year in the date

To improve readability and adhere to common style guides, consider adding a comma after the year in the date.

Apply this change:

-[REST API Now Live](2024-10-10-rest-api-post.md) - October 10, 2024
+[REST API Now Live](2024-10-10-rest-api-post.md) - October 10, 2024,
🧰 Tools
🪛 LanguageTool

[style] ~32-~32: Some style guides suggest that commas should set off the year in a month-day-year date.
Context: ...4-10-10-rest-api-post.md) - October 10, 2024 Learn about our new REST API, its fea...

(MISSING_COMMA_AFTER_YEAR)

docs/bridge/blog-posts/2024-10-10-rest-api-post.md (6)

1-6: Consider uncommenting the authors field

The authors field in the frontmatter is currently commented out. If this is intentional, you may want to remove the line entirely. If not, please uncomment it to properly attribute the post.

-# authors: [synapse]
+authors: [synapse]

11-11: Improve sentence structure

The sentence structure can be improved for better readability.

Consider this revision:

-Last week, we launched the Synapse REST API: [api.synapseprotocol.com](https://api.synapseprotocol.com). The new update is key in making Synapse easier to integrate for applications.
+Last week, we launched the Synapse REST API: [api.synapseprotocol.com](https://api.synapseprotocol.com). This new update is key to making Synapse easier for applications to integrate.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~11-~11: The preposition ‘to’ seems more likely in this position.
Context: ...y in making Synapse easier to integrate for applications. ## Summ...

(AI_HYDRA_LEO_REPLACE_FOR_TO)


17-17: Improve image alt text

The alt text for the image could be more descriptive to improve accessibility.

Consider updating it as follows:

-![REST API flor](./rest-api-flow.png)
+![Synapse REST API flow diagram](./rest-api-flow.png)

25-25: Fix typographical error

There's a minor typographical error in this sentence.

Apply this correction:

-The REST API is also built with third-party developers in mind. Many people run external services around the Synapse Bridge: from arbitrage bots, to on-chain AI agents. The REST API makes it much simpler to interact with the Synapse Bridge from any environment, with just an http request. Third party developers also don't have to sacrifice complexity.
+The REST API is also built with third-party developers in mind. Many people run external services around the Synapse Bridge: from arbitrage bots, to on-chain AI agents. The REST API makes it much simpler to interact with the Synapse Bridge from any environment, with just an HTTP request. Third-party developers also don't have to sacrifice complexity.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~25-~25: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...environment, with just an http request. Third party developers also don't have to sacrifice...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


29-34: Improve grammar and punctuation

There are a few minor grammatical and punctuation issues in this section that can be improved.

Consider these revisions:

-When building the REST API we ran into a couple challenges that have created a more robust developer experience.
+When building the REST API, we ran into a couple of challenges that have created a more robust developer experience.

-*Standardizing Constants:* We needed a set of constants to verify all inputs against, so that users did not attempt to bridge or swap with unsupported assets/chains. This launch gave us the chance to standardize the Synapse Constants library, and extend this library throughout other services.
+*Standardizing Constants:* We needed a set of constants to verify all inputs against, so that users did not attempt to bridge or swap with unsupported assets/chains. This launch gave us the chance to standardize the Synapse Constants library and extend this library throughout other services.

-*Liquidity Warnings:* When bridging programmatically, it's harder to identify abnormalities, thus we added different endpoints to help applications retrieve liquidity parameters before bridging. Responses also include detailed information about what the expected amount will be.
+*Liquidity Warnings:* When bridging programmatically, it's harder to identify abnormalities. Thus, we added different endpoints to help applications retrieve liquidity parameters before bridging. Responses also include detailed information about what the expected amount will be.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~29-~29: Possible missing comma found.
Context: ... ## Challenges When building the REST API we ran into a couple challenges that ha...

(AI_HYDRA_LEO_MISSING_COMMA)


[grammar] ~29-~29: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...hen building the REST API we ran into a couple challenges that have created a more robust develop...

(PLENTY_OF_NOUNS)


[typographical] ~33-~33: The word “thus” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ogrammatically, it's harder to identify abnormalities, thus we added different endpoints to help ap...

(THUS_SENTENCE)


41-48: Improve formatting consistency

The formatting of the new methods list can be improved for better readability and consistency.

Consider applying these changes:

-`/bridgeTxStatus`
-	Enables developers to retrieve the status of any bridge transaction. Helpful for debugging as well as providing transaction level information to the user.
+`/bridgeTxStatus`: Enables developers to retrieve the status of any bridge transaction. Helpful for debugging as well as providing transaction-level information to the user.

-`/destinationTokens`
-	Returns a list of tokens that can be bridged to (given an input token), giving developers clarity on where they can bridge to.
+`/destinationTokens`: Returns a list of tokens that can be bridged to (given an input token), giving developers clarity on where they can bridge to.

-`/bridgeLimits`
-	Returns a max/min amount of tokens to be bridged, giving an accurate representation of liquidity for any possible bridge route.
+`/bridgeLimits`: Returns the maximum and minimum number of tokens that can be bridged, giving an accurate representation of liquidity for any possible bridge route.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~48-~48: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...to. /bridgeLimits Returns a max/min amount of tokens to be bridged, giving an accu...

(AMOUNTOF_TO_NUMBEROF)

🪛 Markdownlint

42-42: Column: 1
Hard tabs

(MD010, no-hard-tabs)


45-45: Column: 1
Hard tabs

(MD010, no-hard-tabs)


48-48: Column: 1
Hard tabs

(MD010, no-hard-tabs)

docs/bridge/docusaurus.config.ts (1)

70-78: LGTM: Comprehensive blog configuration added.

The new blog configuration is well-structured and enables key features. Great job on customizing the sidebar and setting up the edit URLs.

Consider uncommenting and configuring the authorsMapPath option to enable author information for blog posts:

-          // authorsMapPath: 'blog-posts/authors.yml',
+          authorsMapPath: 'blog-posts/authors.yml',

Make sure to create the authors.yml file in the blog-posts directory if it doesn't exist yet.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 4b49879 and f7515a6.

⛔ Files ignored due to path filters (1)
  • docs/bridge/blog-posts/rest-api-flow.png is excluded by !**/*.png
📒 Files selected for processing (5)
  • docs/bridge/blog-posts/2024-10-10-rest-api-post.md (1 hunks)
  • docs/bridge/blog-posts/authors.yml (1 hunks)
  • docs/bridge/blog-posts/welcome.md (1 hunks)
  • docs/bridge/docusaurus.config.ts (2 hunks)
  • docs/bridge/src/pages/index.tsx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • docs/bridge/blog-posts/authors.yml
🧰 Additional context used
🪛 LanguageTool
docs/bridge/blog-posts/2024-10-10-rest-api-post.md

[uncategorized] ~11-~11: The preposition ‘to’ seems more likely in this position.
Context: ...y in making Synapse easier to integrate for applications. ## Summ...

(AI_HYDRA_LEO_REPLACE_FOR_TO)


[uncategorized] ~25-~25: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...environment, with just an http request. Third party developers also don't have to sacrifice...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[uncategorized] ~29-~29: Possible missing comma found.
Context: ... ## Challenges When building the REST API we ran into a couple challenges that ha...

(AI_HYDRA_LEO_MISSING_COMMA)


[grammar] ~29-~29: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...hen building the REST API we ran into a couple challenges that have created a more robust develop...

(PLENTY_OF_NOUNS)


[typographical] ~33-~33: The word “thus” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ogrammatically, it's harder to identify abnormalities, thus we added different endpoints to help ap...

(THUS_SENTENCE)


[uncategorized] ~39-~39: Possible missing comma found.
Context: ...on of new methods to support aggregator integrations such as: /bridgeTxStatus Enables de...

(AI_HYDRA_LEO_MISSING_COMMA)


[uncategorized] ~48-~48: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...to. /bridgeLimits Returns a max/min amount of tokens to be bridged, giving an accu...

(AMOUNTOF_TO_NUMBEROF)

docs/bridge/blog-posts/welcome.md

[style] ~9-~9: Consider using a different adjective to strengthen your wording.
Context: ... [synapse] tags: [synapse] --- We are happy to announce the **Synapse Technical Blo...

(HAPPY_EXCITED)


[style] ~32-~32: Some style guides suggest that commas should set off the year in a month-day-year date.
Context: ...4-10-10-rest-api-post.md) - October 10, 2024 Learn about our new REST API, its fea...

(MISSING_COMMA_AFTER_YEAR)

🪛 Markdownlint
docs/bridge/blog-posts/2024-10-10-rest-api-post.md

42-42: Column: 1
Hard tabs

(MD010, no-hard-tabs)


45-45: Column: 1
Hard tabs

(MD010, no-hard-tabs)


48-48: Column: 1
Hard tabs

(MD010, no-hard-tabs)

🔇 Additional comments (7)
docs/bridge/src/pages/index.tsx (1)

48-48: Verify the new redirect destination and consider future homepage plans.

The implementation is correct, but there are several points to consider:

  1. The redirect destination has changed from '/docs' to '/docs/About/'. Ensure this new path exists and is the intended landing page for users.
  2. By removing the previous implementation, we've lost the potential for a custom homepage. Consider if this aligns with the project's long-term goals.
  3. There's a significant amount of commented-out code, including imports and component structures. This suggests a more comprehensive homepage was planned.

To verify the existence of the new redirect destination, run:

Consider the following architectural points:

  1. If a custom homepage is planned for the future, it might be beneficial to create a placeholder or minimal version rather than redirecting.
  2. Evaluate if the commented-out code should be removed entirely or if it represents future requirements that should be tracked as issues.

Clean up the file by removing commented-out code if it's no longer needed. This will improve code readability and maintenance.

docs/bridge/blog-posts/welcome.md (3)

1-6: Verify the intention of the commented authors line

The authors field in the frontmatter is currently commented out. Is this intentional, or should it be uncommented and populated with the appropriate author(s)?

If it should be uncommented, consider updating it like this:

-# authors: [synapse]
+authors: [synapse]

16-26: LGTM! Comprehensive content overview and clear target audience.

This section effectively outlines the types of content readers can expect and clearly defines the target audience. It provides a good balance of technical topics that would be valuable for developers and integrators.


28-33: Verify the date of the REST API post and consider adding a placeholder

The date for the REST API post (October 10, 2024) is in the future. Please verify if this is intentional for a scheduled post or if it needs to be updated to the correct date.

Additionally, consider adding a placeholder or comment for future articles to make it easier to update this section. For example:

 - [REST API Now Live](2024-10-10-rest-api-post.md) - October 10, 2024
   Learn about our new REST API, its features, and how it simplifies integration for developers.

+<!-- Add new articles above this line -->
+<!-- Example: - [Article Title](article-link.md) - Month Day, Year -->
🧰 Tools
🪛 LanguageTool

[style] ~32-~32: Some style guides suggest that commas should set off the year in a month-day-year date.
Context: ...4-10-10-rest-api-post.md) - October 10, 2024 Learn about our new REST API, its fea...

(MISSING_COMMA_AFTER_YEAR)

docs/bridge/docusaurus.config.ts (3)

67-69: LGTM: Explicit docs configuration.

The addition of explicit routeBasePath and path settings for the docs configuration is good practice. It clearly defines the structure for documentation pages.


102-108: LGTM: Navbar updated with Docs and Blog links.

The addition of Docs and Blog links to the navbar improves site navigation. The configuration is correct and consistent with the earlier changes.


Line range hint 214-214: LGTM: Improved type checking with satisfies operator.

The use of the satisfies operator in the default export enhances type safety without affecting type inference. This is a good TypeScript practice.

@@ -60,15 +60,26 @@ const config: Config = {
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl:
'https://github.com/synapsecns/sanguine/tree/master/docs/bridge/',
'https://github.com/synapsecns/sanguine/edit/master/docs/bridge/blog-posts/',
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Verify the editUrl path for docs configuration.

The editUrl path has been updated to include 'blog-posts', which seems inconsistent with the docs configuration. This might lead to incorrect edit links for documentation pages.

Consider reverting this change or updating it to the correct path for documentation edits:

-            'https://github.com/synapsecns/sanguine/edit/master/docs/bridge/blog-posts/',
+            'https://github.com/synapsecns/sanguine/edit/master/docs/bridge/',
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
'https://github.com/synapsecns/sanguine/edit/master/docs/bridge/blog-posts/',
'https://github.com/synapsecns/sanguine/edit/master/docs/bridge/',

Copy link

codecov bot commented Oct 8, 2024

Bundle Report

Changes will decrease total bundle size by 3.5MB (-9.82%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
sdk-router-@synapsecns/sdk-router-esm* 255.08kB 426 bytes (0.17%) ⬆️
sdk-router-@synapsecns/sdk-router-cjs* 527.17kB 409.93kB (349.65%) ⬆️
explorer-ui-server-cjs* 708.77kB 157.29kB (-18.16%) ⬇️
explorer-ui-client-array-push* 2.15MB 162.81kB (-7.04%) ⬇️
synapse-interface-client-array-push* 7.38MB 100.07kB (1.38%) ⬆️
synapse-interface-server-cjs* 1.65MB 150.9kB (10.1%) ⬆️
widget-cjs-esm* 271.27kB 2.03kB (-0.74%) ⬇️
docs-bridge-client-array-push 7.28MB 619.5kB (-7.84%) ⬇️
docs-bridge-server-cjs 11.31MB 3.57MB (-23.99%) ⬇️
synapse-constants-esm-cjs* 174.63kB 174.63kB (100%) ⬆️
synapse-constants-cjs-esm* 174.18kB 174.18kB (100%) ⬆️

ℹ️ *Bundle size includes cached data from a previous commit

@github-actions github-actions bot added size/m and removed size/s labels Oct 8, 2024
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (10)
docs/bridge/src/css/custom.css (1)

24-30: LGTM! Consider adding comments for clarity.

The new custom properties for method and figure colors are well-defined and consistent with the existing naming convention. The use of HSL notation is excellent for maintainability.

Consider adding brief comments to explain the purpose of these new color variables, especially if they are used for specific components or elements in the documentation.

+ /* Syntax highlighting colors */
  --syn-method: hsl(225deg 100% 45%);
  
+ /* Figure element colors */
  --syn-fig-green: hsl(165deg 100% 28%);
  --syn-fig-blue: hsl(210deg 100% 45%);
  --syn-fig-purple: hsl(285deg 100% 50%);
  --syn-fig-magenta: hsl(330deg 100% 60%);
docs/bridge/blog-posts/2024-10-10-rest-api-post.md (4)

1-9: Consider uncommenting the authors field in the frontmatter.

The frontmatter looks good, but the authors field is currently commented out. If you want to attribute this post to specific authors, you should uncomment and populate this field.

-# authors: [synapse]
+authors: [synapse]

25-30: Improve clarity and correct minor issues in the "Why it Matters" section.

The content effectively communicates the benefits of the API. Consider the following improvements:

  1. In the first paragraph, add a comma after "users" for better readability.
  2. In the second paragraph, hyphenate "third-party" when used as a compound adjective.
  3. Consider rephrasing the last sentence for clarity.

Here's a suggested revision for the last two sentences:

-The REST API is also built with third-party developers in mind. Many people run external services around the Synapse Bridge: from arbitrage bots, to on-chain AI agents. The REST API makes it much simpler to interact with the Synapse Bridge from any environment, with just an http request. Third party developers also don't have to sacrifice complexity.
+The REST API is also built with third-party developers in mind. Many people run external services around the Synapse Bridge, from arbitrage bots to on-chain AI agents. The REST API makes it much simpler to interact with the Synapse Bridge from any environment with just an HTTP request, while still allowing third-party developers to leverage its full complexity when needed.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~29-~29: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...environment, with just an http request. Third party developers also don't have to sacrifice...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


31-38: Enhance clarity and correct minor issues in the "Challenges" section.

The content provides valuable insights into the development process. Consider the following improvements:

  1. In the first sentence, replace "couple challenges" with "couple of challenges" for grammatical correctness.
  2. In the "Standardizing Constants" paragraph, consider rephrasing for clarity.
  3. In the "Liquidity Warnings" paragraph, use a semicolon instead of a comma before "thus".

Here are suggested revisions:

-When building the REST API we ran into a couple challenges that have created a more robust developer experience.
+When building the REST API, we encountered a couple of challenges that have led to a more robust developer experience.

-*Standardizing Constants:* We needed a set of constants to verify all inputs against, so that users did not attempt to bridge or swap with unsupported assets/chains. This launch gave us the chance to standardize the Synapse Constants library, and extend this library throughout other services.
+*Standardizing Constants:* We needed a set of constants to verify all inputs, preventing users from attempting to bridge or swap with unsupported assets/chains. This launch provided an opportunity to standardize the Synapse Constants library and extend it throughout other services.

-*Liquidity Warnings:* When bridging programmatically, it's harder to identify abnormalities, thus we added different endpoints to help applications retrieve liquidity parameters before bridging. Responses also include detailed information about what the expected amount will be.
+*Liquidity Warnings:* When bridging programmatically, it's harder to identify abnormalities; thus, we added different endpoints to help applications retrieve liquidity parameters before bridging. Responses also include detailed information about the expected amount.
🧰 Tools
🪛 LanguageTool

[grammar] ~33-~33: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...hen building the REST API we ran into a couple challenges that have created a more robust develop...

(PLENTY_OF_NOUNS)


[typographical] ~37-~37: The word “thus” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ogrammatically, it's harder to identify abnormalities, thus we added different endpoints to help ap...

(THUS_SENTENCE)


39-60: Improve formatting consistency and address minor issues in the "Launch Details" section.

The content is informative and well-structured. Consider the following improvements:

  1. Use spaces instead of tabs for indentation in bullet points for consistency with Markdown best practices.
  2. Capitalize "HTTP" in "http request" for correctness.
  3. Add a hyphen to "hot-reloading" for consistency.
  4. Consider rephrasing some sentences for clarity.

Here are suggested revisions:

`/bridgeTxStatus`
-	Enables developers to retrieve the status of any bridge transaction. Helpful for debugging as well as providing transaction level information to the user.
+    Enables developers to retrieve the status of any bridge transaction. Helpful for debugging as well as providing transaction-level information to the user.

`/destinationTokens`
-	Returns a list of tokens that can be bridged to (given an input token), giving developers clarity on where they can bridge to.
+    Returns a list of tokens that can be bridged to (given an input token), providing developers clarity on available bridge destinations.

`/bridgeLimits`
-	Returns a max/min amount of tokens to be bridged, giving an accurate representation of liquidity for any possible bridge route.
+    Returns the maximum and minimum number of tokens that can be bridged, providing an accurate representation of liquidity for any possible bridge route.

Other main changes include:
- Standardized RESTful responses, eliminated mixed response types (Markup and JSON) to now consistently return JSON for all endpoints.
- Enhanced error handling using input validations with express-validator, middleware for error handling. Includes checks for unsupported chains, bridge modules, tokens and a friendly error message indicating specific error messages.
- Architectural improvements including a traditional MVC approach, separating routes and controllers, improved code readability and organization, so we can easily compose new routes
-Development workflow updates, like yarn dev which has hot reloading so we don't need to manually stop and restart the server during development
+- Development workflow updates, like `yarn dev` which has hot-reloading so we don't need to manually stop and restart the server during development

-Swagger documentation was also included in the latest release to assist developer onboarding.
+Swagger documentation was also included in the latest release to assist with developer onboarding.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~52-~52: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...to. /bridgeLimits Returns a max/min amount of tokens to be bridged, giving an accu...

(AMOUNTOF_TO_NUMBEROF)

🪛 Markdownlint

46-46: Column: 1
Hard tabs

(MD010, no-hard-tabs)


49-49: Column: 1
Hard tabs

(MD010, no-hard-tabs)


52-52: Column: 1
Hard tabs

(MD010, no-hard-tabs)

docs/bridge/src/components/APIFlow.tsx (5)

1-9: LGTM! Consider adding accessibility attributes.

The component declaration and SVG container setup look good. The use of percentage width allows for responsiveness, which is a plus.

Consider adding accessibility attributes to the SVG, such as role="img" and aria-label="API Flow Diagram", to improve accessibility for screen readers.

 <svg
   width="100%"
   viewBox="-240 0 480 120"
   fill="none"
   xmlns="http://www.w3.org/2000/svg"
   className="flowAnimation"
+  role="img"
+  aria-label="API Flow Diagram"
 >

10-83: Well-structured SVG definitions. Consider consistent naming.

The SVG definitions are well-organized and make good use of reusable elements. The use of CSS variables for colors is excellent for theming and maintainability.

For consistency, consider using camelCase for all marker IDs. For example:

-  id="synFigDiamondPurple"
+  id="synFigDiamondPurple"
-  id="synFigDiamondMagenta"
+  id="synFigDiamondMagenta"
-  id="synFigArrowMagenta"
+  id="synFigArrowMagenta"
-  id="synFigArrowPurple"
+  id="synFigArrowPurple"
-  id="synFigArrowGreen"
+  id="synFigArrowGreen"
-  id="synFigArrowBlue"
+  id="synFigArrowBlue"

This change would align with JavaScript naming conventions and improve consistency throughout the component.


84-120: Effective use of SVG elements for diagram structure. Consider extracting repeated values.

The background rectangles and paths effectively create the structure of the API flow diagram. The use of markers for flow direction is particularly helpful for visual clarity.

To improve maintainability, consider extracting repeated values into constants or a configuration object. For example:

const RECT_RADIUS = 4;
const MARKER_CONFIG = {
  start: {
    green: 'url(#synFigArrowGreen)',
    blue: 'url(#synFigArrowBlue)',
    purple: 'url(#synFigDiamondPurple)',
    magenta: 'url(#synFigDiamondMagenta)',
  },
  end: {
    green: 'url(#synFigArrowGreen)',
    blue: 'url(#synFigArrowBlue)',
    purple: 'url(#synFigArrowPurple)',
    magenta: 'url(#synFigArrowMagenta)',
  },
};

// Usage example
<rect x="-50%" rx={RECT_RADIUS} y="0" width="100%" height="56" />
<path
  stroke="var(--syn-fig-green)"
  fill="none"
  d="M-180 84 H-92 V44"
  markerStart={MARKER_CONFIG.start.green}
  markerEnd={MARKER_CONFIG.end.green}
/>

This approach would make it easier to maintain consistent values across the component and simplify future updates.


121-200: Clear labeling with text elements. Consider extracting styles and improving consistency.

The text elements effectively label the different components of the API flow diagram. The positioning and styling contribute to a clear and readable visualization.

Consider the following improvements:

  1. Extract inline styles to a separate CSS file or use styled-components for better separation of concerns:
// In a separate CSS file or styled-component
.api-flow-text {
  font-size: 0.9em;
}

.api-flow-small-text {
  font-size: 0.75em;
}

// In the component
<g className="api-flow-text" fill="currentcolor" dominantBaseline="middle">
  {/* ... */}
</g>

<g className="api-flow-small-text" textAnchor="middle" dominantBaseline="middle">
  {/* ... */}
</g>
  1. Use consistent naming for CSS variables:
-  fill="var(--syn-fig-green)"
+  fill="var(--syn-fig-color-green)"
-  fill="var(--syn-fig-blue)"
+  fill="var(--syn-fig-color-blue)"
-  fill="var(--syn-fig-purple)"
+  fill="var(--syn-fig-color-purple)"
-  fill="var(--syn-fig-magenta)"
+  fill="var(--syn-fig-color-magenta)"
  1. Consider using a mapping object for text content to make it easier to update or localize in the future:
const TEXT_CONTENT = {
  restApi: 'REST API',
  bridge: '/bridge',
  bridgeTxInfo: '/bridgeTxInfo',
  contract: 'Contract',
  app: 'App',
  chain: 'Chain',
  quote: 'Quote',
  data: 'Data',
  sign: 'Sign',
  submit: 'Submit',
};

// Usage
<text x="-216" y="29">{TEXT_CONTENT.restApi}</text>

These changes would improve maintainability and make the component more flexible for future updates.


1-203: Well-implemented API flow diagram. Consider future enhancements for flexibility and reusability.

Overall, this component effectively creates a detailed and visually appealing SVG representation of the API flow. The use of SVG ensures scalability and responsiveness, which is crucial for various display contexts.

For future iterations, consider the following enhancements:

  1. Parameterize the component:
    Allow customization of colors, labels, and flow structure through props. This would make the component more reusable across different API flows or allow for easy updates.

    interface APIFlowProps {
      colors: Record<string, string>;
      labels: Record<string, string>;
      flowStructure: FlowStructureType; // Define this type based on your needs
    }
    
    export const APIFlow: React.FC<APIFlowProps> = ({ colors, labels, flowStructure }) => {
      // Use these props to render the diagram
    };
  2. Implement responsive behavior:
    Add logic to adjust text size or element positioning based on the SVG's rendered size to ensure readability on various screen sizes.

  3. Create sub-components:
    Break down the SVG into smaller, reusable components (e.g., <FlowNode>, <FlowConnection>) to improve code organization and maintainability.

  4. Add interactivity:
    Consider adding hover effects or click events to provide more detailed information about each step in the flow.

  5. Implement animations:
    Utilize CSS animations or a library like React Spring to animate the flow, enhancing user engagement and understanding of the process.

These enhancements would make the component more flexible, maintainable, and engaging for users while preserving its current effectiveness in visualizing the API flow.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between f7515a6 and ac3b326.

📒 Files selected for processing (5)
  • docs/bridge/blog-posts/2024-10-10-rest-api-post.md (1 hunks)
  • docs/bridge/docs/02-Bridge/05-Supported-Routes.md (1 hunks)
  • docs/bridge/docs/02-Bridge/_05-Supported-Routes.md (1 hunks)
  • docs/bridge/src/components/APIFlow.tsx (1 hunks)
  • docs/bridge/src/css/custom.css (2 hunks)
✅ Files skipped from review due to trivial changes (2)
  • docs/bridge/docs/02-Bridge/05-Supported-Routes.md
  • docs/bridge/docs/02-Bridge/_05-Supported-Routes.md
🧰 Additional context used
🪛 LanguageTool
docs/bridge/blog-posts/2024-10-10-rest-api-post.md

[uncategorized] ~29-~29: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...environment, with just an http request. Third party developers also don't have to sacrifice...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[grammar] ~33-~33: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...hen building the REST API we ran into a couple challenges that have created a more robust develop...

(PLENTY_OF_NOUNS)


[typographical] ~37-~37: The word “thus” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ogrammatically, it's harder to identify abnormalities, thus we added different endpoints to help ap...

(THUS_SENTENCE)


[uncategorized] ~52-~52: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...to. /bridgeLimits Returns a max/min amount of tokens to be bridged, giving an accu...

(AMOUNTOF_TO_NUMBEROF)

🪛 Markdownlint
docs/bridge/blog-posts/2024-10-10-rest-api-post.md

21-21: Column: 1
Hard tabs

(MD010, no-hard-tabs)


22-22: Column: 1
Hard tabs

(MD010, no-hard-tabs)


46-46: Column: 1
Hard tabs

(MD010, no-hard-tabs)


49-49: Column: 1
Hard tabs

(MD010, no-hard-tabs)


52-52: Column: 1
Hard tabs

(MD010, no-hard-tabs)

🔇 Additional comments (4)
docs/bridge/src/css/custom.css (2)

Line range hint 97-99: Clarify the intent of removing width from figure.

The removal of the width property from the figure element styling could impact the layout of figures in the documentation. While this change allows for more flexible figure layouts, it's important to ensure it doesn't negatively affect the current design.

Could you please clarify the reasoning behind this change? Additionally, it would be beneficial to verify the impact of this change across different screen sizes and document types.

To help with verification, you can run the following script to find all usage of <figure> elements in the documentation:

#!/bin/bash
# Description: Find usage of <figure> elements in documentation

echo "Searching for <figure> elements in documentation:"
rg --type html --type mdx '<figure' docs/

This will help identify areas where the layout might be affected by the removal of the width property.


58-64: LGTM! Clarification needed on --syn-method color.

The new custom properties for the dark theme are well-defined and appropriately adjusted for better visibility in dark mode. The use of HSL notation maintains consistency and allows for easy comparisons.

Could you please clarify the reasoning behind the significant color change for --syn-method between light and dark themes (blue to yellow)? This might affect the visual consistency of syntax highlighting across themes.

To verify the usage of these colors, let's run the following script:

This will help us understand how these new color variables are being used across the documentation.

docs/bridge/blog-posts/2024-10-10-rest-api-post.md (2)

10-23: Great introduction and summary!

The introduction effectively announces the launch of the Synapse REST API, and the summary provides a clear explanation of its purpose and functionality. The use of the <!--truncate--> comment is correct for blog post previews.

🧰 Tools
🪛 Markdownlint

21-21: Column: 1
Hard tabs

(MD010, no-hard-tabs)


22-22: Column: 1
Hard tabs

(MD010, no-hard-tabs)


1-60: Excellent blog post announcing the Synapse REST API!

The document is well-structured, informative, and effectively communicates the launch and benefits of the Synapse REST API. The content covers all essential aspects, including the API's purpose, challenges faced during development, and key features.

To ensure the highest quality, please consider the following:

  1. Implement the suggested improvements from previous comments to enhance readability and correctness.
  2. Conduct a final proofreading pass to catch any remaining minor issues.
  3. Verify that all technical details, such as endpoint names and functionality, are accurate.

To assist with the verification process, you can run the following script:

This script will help ensure that the endpoint names are consistent throughout the document and that there are no remaining TODO comments.

✅ Verification successful

Verification Successful: Endpoint names are consistent and no TODO comments found in the reviewed document.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the accuracy of endpoint names and check for any TODO comments

# Test: Search for endpoint names to ensure consistency
echo "Checking endpoint names:"
rg --type markdown '/bridgeTxStatus|/destinationTokens|/bridgeLimits'

# Test: Look for any remaining TODO comments
echo "Checking for TODO comments:"
rg --type markdown 'TODO'

Length of output: 5011

🧰 Tools
🪛 LanguageTool

[uncategorized] ~29-~29: If this is a compound adjective that modifies the following noun, use a hyphen.
Context: ...environment, with just an http request. Third party developers also don't have to sacrifice...

(EN_COMPOUND_ADJECTIVE_INTERNAL)


[grammar] ~33-~33: Using ‘couple’ without ‘of’ is considered to be informal.
Context: ...hen building the REST API we ran into a couple challenges that have created a more robust develop...

(PLENTY_OF_NOUNS)


[typographical] ~37-~37: The word “thus” is an adverb that can’t be used like a conjunction, and therefore needs to be separated from the sentence.
Context: ...ogrammatically, it's harder to identify abnormalities, thus we added different endpoints to help ap...

(THUS_SENTENCE)


[uncategorized] ~52-~52: ‘Amount of’ should usually only be used with uncountable or mass nouns. Consider using “number” if this is not the case.
Context: ...to. /bridgeLimits Returns a max/min amount of tokens to be bridged, giving an accu...

(AMOUNTOF_TO_NUMBEROF)

🪛 Markdownlint

21-21: Column: 1
Hard tabs

(MD010, no-hard-tabs)


22-22: Column: 1
Hard tabs

(MD010, no-hard-tabs)


46-46: Column: 1
Hard tabs

(MD010, no-hard-tabs)


49-49: Column: 1
Hard tabs

(MD010, no-hard-tabs)


52-52: Column: 1
Hard tabs

(MD010, no-hard-tabs)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Outside diff range and nitpick comments (2)
docs/bridge/docs/02-Bridge/_05-Supported-Routes.md (2)

1-3: Consider adding more frontmatter properties

The frontmatter currently only includes the sidebar_label. Consider adding other common properties such as title and description to improve SEO and document structure.

Example addition:

---
sidebar_label: Supported Routes
title: Supported Routes for Synapse Bridge
description: Information on supported tokens and routes for each chain in the Synapse Bridge
---

7-15: Content looks good, consider adding more details

The content provides clear and concise information about supported routes. The tip about route availability is particularly helpful.

Consider enhancing the content with:

  1. A brief explanation of what "routes" means in this context.
  2. An example of how to check route availability using the Synapse Bridge.
  3. Any limitations or important considerations when using these routes.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between ac3b326 and c837def.

📒 Files selected for processing (2)
  • docs/bridge/docs/02-Bridge/_05-Supported-Routes.md (1 hunks)
  • docs/bridge/docusaurus.config.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/bridge/docusaurus.config.ts
🧰 Additional context used
🔇 Additional comments (2)
docs/bridge/docs/02-Bridge/_05-Supported-Routes.md (2)

17-17: Verify correct usage of the Routes component

The Routes component is used without any props. Ensure that this is the intended usage and that the component doesn't require any mandatory props.

Run the following script to check the Routes component implementation for any required props:


5-5: Verify the Routes component implementation

The file imports a Routes component. Ensure that this component is correctly implemented and exists at the specified path.

Run the following script to check for the component's existence:

✅ Verification successful

Re-verify the Routes component implementation

The previous script encountered errors while searching for the Routes component. Please run the updated script below to ensure the component exists and is correctly implemented:


Routes component correctly implemented and located

The Routes component exists at ./docs/bridge/src/components/Routes.tsx as specified in the import statement. No issues found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check if the Routes component exists

# Test: Search for the Routes component file
fd --type f Routes.js Routes.jsx Routes.ts Routes.tsx --exec echo "Routes component found: {}"

# If not found, check for any file containing a Routes component definition
if [ $? -ne 0 ]; then
  echo "Searching for Routes component definition..."
  rg --type-add 'react:*.{js,jsx,ts,tsx}' --type react 'export .*function Routes' -l
fi

Length of output: 509


Script:

#!/bin/bash
# Description: Re-check if the Routes component exists with corrected commands

# Search for the Routes component file with specified extensions
fd Routes -e js -e jsx -e ts -e tsx --type file --exec echo "Routes component found: {}"

# If not found, search for any file containing a Routes component definition
if [ $? -ne 0 ]; then
  echo "Searching for Routes component definition..."
  rg 'export\s+(default\s+)?function\s+Routes\b' --type-add 'react:*.{js,jsx,ts,tsx}' --type react -l
fi

Length of output: 514

@Defi-Moses Defi-Moses merged commit f60a8b4 into master Oct 8, 2024
42 checks passed
@Defi-Moses Defi-Moses deleted the docs/blog-api-img branch October 8, 2024 22:59
This was referenced Oct 8, 2024
@coderabbitai coderabbitai bot mentioned this pull request Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants