Skip to content

[EDU-1845] Pub/Sub getting started in JavaScript #2511

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

Merged
merged 2 commits into from
Apr 29, 2025

Conversation

m-hulbert
Copy link
Contributor

Description

This PR adds a new getting started guide for Ably Pub/Sub in JavaScript.

It includes;

  • A new getting started guide for Pub/Sub in JavaScript.
  • Adds the guide to the existing 'getting started' section for now. Other items will be moved/removed once there are more guides.
  • Adjusts the padding on h2, ol and ul elements for readability in the getting started guide.

Checklist

@m-hulbert m-hulbert self-assigned this Apr 8, 2025
Copy link

coderabbitai bot commented Apr 8, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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
Contributor

@GregHolmes GregHolmes left a comment

Choose a reason for hiding this comment

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

Just a few comments.

@m-hulbert m-hulbert temporarily deployed to ably-docs-edu-1845-pubs-jstarl April 9, 2025 12:47 Inactive
@m-hulbert m-hulbert requested a review from GregHolmes April 9, 2025 12:48
@m-hulbert m-hulbert temporarily deployed to ably-docs-edu-1845-pubs-jstarl April 9, 2025 13:27 Inactive
Copy link
Contributor

@mschristensen mschristensen 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, couple small comments.

There is no error handling or graceful teardown logic in this example. I do think that might be an important thing for users to be made aware of early on in their experimentation - equally I can see the desire to keep this lean. What do you think?

I have a question about how we intend to approach the JS/TS ecosystems with these guides - not something that needs to block this PR, but I do think we need to solve this more generally:

  • Will we have typescript equivalents?
    • More generally, how do we intend to manage JS vs TS in all code examples throughout the docs? Of course they are both AblyJS, but the usage examples will differ. Should we have a TS option in the language selector dropdown?
  • How to we handle running code snippets for JS/TS via Node vs the browser?
    • Some of the setup steps may differ, e.g. use ts-node vs use webpack vs include a script tag in an index.html, etc. How do other companies solve this problem in their guides?

@m-hulbert
Copy link
Contributor Author

Looks great, couple small comments.

There is no error handling or graceful teardown logic in this example. I do think that might be an important thing for users to be made aware of early on in their experimentation - equally I can see the desire to keep this lean. What do you think?

I have a question about how we intend to approach the JS/TS ecosystems with these guides - not something that needs to block this PR, but I do think we need to solve this more generally:

  • Will we have typescript equivalents?

    • More generally, how do we intend to manage JS vs TS in all code examples throughout the docs? Of course they are both AblyJS, but the usage examples will differ. Should we have a TS option in the language selector dropdown?
  • How to we handle running code snippets for JS/TS via Node vs the browser?

    • Some of the setup steps may differ, e.g. use ts-node vs use webpack vs include a script tag in an index.html, etc. How do other companies solve this problem in their guides?

Thanks Mike.

  • I've added a section on closing the connection with some info on unsubscribing and detaching too.
  • RE: JS vs TS and browser vs node... honestly I think we could quite easily expand on these guides with minimal effort to cover a TS version and a browser-based version.
  • In terms of TS code snippets too - I'd actually be in favour of removing the node ones we currently provide and replacing those with TS equivalents instead. What are your thoughts on that?

@m-hulbert m-hulbert requested a review from mschristensen April 24, 2025 16:37
@m-hulbert m-hulbert temporarily deployed to ably-docs-edu-1845-pubs-nrzsym April 24, 2025 16:38 Inactive
@m-hulbert m-hulbert temporarily deployed to ably-docs-edu-1845-pubs-nrzsym April 28, 2025 08:44 Inactive
@m-hulbert m-hulbert force-pushed the edu-1845-pubsub-js-start branch from 25f3456 to 80a3b87 Compare April 29, 2025 06:59
@m-hulbert m-hulbert temporarily deployed to ably-docs-edu-1845-pubs-nrzsym April 29, 2025 07:00 Inactive
Copy link
Contributor

@mschristensen mschristensen left a comment

Choose a reason for hiding this comment

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

LGTM

@m-hulbert m-hulbert force-pushed the edu-1845-pubsub-js-start branch from 80a3b87 to d6aeb8a Compare April 29, 2025 15:05
@m-hulbert m-hulbert temporarily deployed to ably-docs-edu-1845-pubs-nrzsym April 29, 2025 15:06 Inactive
@m-hulbert m-hulbert merged commit fe3cebd into main Apr 29, 2025
6 checks passed
@m-hulbert m-hulbert deleted the edu-1845-pubsub-js-start branch April 29, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants