-
Notifications
You must be signed in to change notification settings - Fork 27
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
chore: add examples for new JS config options, other minor cleanups #658
Conversation
This commit adds a "config-and-error-handling" page for the node.js SDK, and in there we show some examples of how to use the succinct version of the constructor without specifying an explicit config. We also show an example of using the new `WithThrowOnErrors` configuration option. Also did a few other cleanups while I was in here, including: * add missing example code for Lambda configuration on Configurations page. * Remove all the "COMING SOON"s * Fixed the order of the `TopicClient` example on the topics API reference page. * Removed some redundant copies of stuff like 'observability' that was duplicated between "Topics" and "Cache" sections; but then gave up on this in favor of moving the "SDKs" stuff up to the top level in a subsequent PR after discussion with Allen.
import { SdkExampleCodeBlock } from "@site/src/components/SdkExampleCodeBlock"; | ||
// This import is necessary even though it looks like it's un-used; The inject-example-code-snippet | ||
// plugin will transform instances of SdkExampleCodeBlock to SdkExampleCodeBlockImpl | ||
import { SdkExampleCodeBlockImpl } from "@site/src/components/SdkExampleCodeBlockImpl"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@allenheltondev this is the main file I wanted to get your input on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most of these updates are really SEO-driven in nature, but go a long way when it's consistent across the board.
--- | ||
sidebar_position: 2 | ||
sidebar_label: Config and Error Handling | ||
title: Observability for TypeScript and Node.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title
and description
are the fields used for social cards when a link is shared via slack/social media. We always need to make sure we're updating these and adding keywords
for SEO purposes.
title
: Observe your Momento Cache metrics in TypeScript and Node.js
description
: Learn how to add observability tools into your TypeScript and Node.js code for viewing Momento Cache metrics.
keywords
:
- momento
- cache
- serverless
- observability
- sdk
|
||
# Configuration and Error Handling in the Momento node.js SDK | ||
|
||
## Configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the h2. The title should suffice
// plugin will transform instances of SdkExampleCodeBlock to SdkExampleCodeBlockImpl | ||
import { SdkExampleCodeBlockImpl } from "@site/src/components/SdkExampleCodeBlockImpl"; | ||
|
||
# Configuration and Error Handling in the Momento node.js SDK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The title of our docs pages should read like a story title
How configuration and error handling works in the Momento Node.js SDK
|
||
<SdkExampleCodeBlock language={'javascript'} snippetId={'configuration_ConstructWithLambdaConfig'} /> | ||
|
||
If you omit the configuration, Momento will use the `Laptop` configuration by default. This configuration has relaxed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be in a Tip annotation
:::tip
If you omit the configuration, Momento will use the `Laptop` configuration by default. This configuration has relaxed timeouts, suitable for development or in high-latency environments. **It is not recommended for production, server-side use**.
:::
@@ -1,12 +1,12 @@ | |||
--- | |||
sidebar_position: 1 | |||
title: Momento Topics Node.js SDK | |||
title: Momento Node.js SDK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since this is for a social card, I'm wondering if we should include topics in the name.
title
: Momento Node.js SDK | Topics
description
: Get started using the Momento Node.js SDK for Topics today. Discover system requirements, explore our cheat sheets, and learn about cool integrations with one-click installs.
keywords
:
- momento
- topics
- nodejs
- sdk
- eda
- event-driven architecture
@allenheltondev - addressed your comments in 5b7bc75 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
This commit adds a "config-and-error-handling" page for the node.js
SDK, and in there we show some examples of how to use the succinct
version of the constructor without specifying an explicit config.
We also show an example of using the new
WithThrowOnErrors
configurationoption.
Also did a few other cleanups while I was in here, including:
TopicClient
example on the topics API reference page.between "Topics" and "Cache" sections; but then gave up on this in favor of
moving the "SDKs" stuff up to the top level in a subsequent PR after discussion
with Allen.