Skip to content

Commit 6f4413f

Browse files
committed
reorg examples
1 parent 8afe1d1 commit 6f4413f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1058
-2363
lines changed

README.md

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,25 @@
1-
# NATS.js - A [NATS](http://nats.io) client for JavaScript
1+
# NATS.js - The JavaScript clients for [NATS](http://nats.io)
22

33
[![License](https://img.shields.io/badge/Licence-Apache%202.0-blue.svg)](./LICENSE)
44
![Test NATS.deno](https://github.com/nats-io/nats.deno/workflows/NATS.deno/badge.svg)
55
[![Coverage Status](https://coveralls.io/repos/github/nats-io/nats.deno/badge.svg?branch=main)](https://coveralls.io/github/nats-io/nats.deno?branch=main)
66

7-
This repository hosts NATS clients for JavaScript runtimes, including:
7+
Welcome to the new NATS.js repository! Beginning with the v3 release of the
8+
JavaScript clients, the NATS.js repository reorganizes the NATS JavaScript
9+
client libraries into a formal mono-repo.
10+
11+
This repository hosts native runtime support ("transports") for:
812

913
- Deno
1014
- Node/Bun
1115
- Browsers (W3C websocket)
1216

13-
The repository is a mono-repo which the various runtime transports and a set of
14-
common modules (libraries) that shape the transports into a NATS client.
15-
16-
Previous versions of the NATS clients merged the specific transport
17-
functionality (runtime) with the "NATS Base Client", the library providing the
18-
APIs to interact with the NATS server.
17+
A big change with the v3 clients is that the "nats-base-client" which implements
18+
all the runtime agnostic functionality of the clients, is now split into several
19+
modules. This split simplify the initial user experience as well as the
20+
development and evolution of the current functionality.
1921

20-
In order to be more flexible and allow the ecosystem to more easily grow the
21-
basic functionality has been split into 5 modules:
22+
The new modules are:
2223

2324
- [Core](core/README.md) which implements basic NATS core functionality
2425
- [JetStream](jetstream/README.md) which implements JetStream functionality
@@ -28,37 +29,36 @@ basic functionality has been split into 5 modules:
2829
- [Services](obj/README.md) which implements a framework for building NATS
2930
services
3031

31-
The above modules provide a different way for working with NATS. If you are
32-
getting started, perhaps you heard about the NATS KV and would incorporate it
33-
into your app. The KV module may be all that you need to get started. You will
34-
of course need a transport, but once you know how to make a connection to NATS,
35-
you can bypass much of the APIs and simply focus on the one that grabbed your
36-
attention. From there feel free to explore the different aspects of NATS. At
37-
some point, we are certain that your use most, if not all, of the modules.
38-
39-
This allows basic clients to be smaller as features such as JetStream or KV are
40-
opt-in components, and also allowing each module to be versioned separately.
41-
This provides some additional developer comfort as it allows each module to
42-
specify its own [semantic version](https://semver.org/), and thus prevent
32+
If you are getting started with NATS for the first time, we now have the
33+
opportunity to have a simplified on-boarding experience that allows you to go
34+
into one of our NATS technologies. Perhaps you heard about the NATS KV and would
35+
like to incorporate it into your app. The KV module will shortcut a lot of
36+
things for you. You will of course need a transport which will connect you to a
37+
NATS server, but once you know how to create a connection you will be focusing
38+
on a smaller subset of the APIs. From there, we are certain that you will
39+
broaden your use of NATS into other areas.
40+
41+
Another reason for the change is that it has the potential to make your client a
42+
bit smaller, and if versions change on a submodule that you don't use, you won't
43+
be confronted with an upgrade choice. It also allows us to version more
44+
strictly, and thus telegraph to you the effort or scope of changes and prevent
4345
surprises when upgrading.
4446

45-
The decoupling of the NATS client functionality from the actual runtime, also
46-
enables developers to write modules that can run on different runtimes provided
47-
they follow a pattern where a `NatsConnection` is used regardless of the actual
48-
runtime. For example, the JetStream module exposes a `jetstream()` function that
49-
will return a JetStream API that you use to interact with JetStream. The actual
50-
connection type is not important, and the library will work regardless of the
51-
runtime provided the runtime has the minimum support required by the library.
52-
53-
[//]: # (- [Node Transport]() which implements a TCP transport for Node.js)
54-
[//]: # (- [WebSocket Transport]() which implements a W3C compatible websocket transport)
55-
[//]: # ( that can run in Deno, Node.js (22), and Browsers.)
47+
The decoupling of the NATS client functionality from a transport, also enables
48+
developers to create new modules that can run all runtimes so long as they
49+
follow a pattern where a `NatsConnection` (or some other standard interface) is
50+
used as the basis of the module. For example, the JetStream module exposes a
51+
`jetstream()` and `jetstreamManager()` functions that will return a JetStream
52+
API that you use to interact with JetStream for creating resources or consuming
53+
streams. The actual connection type is not important, and the library will work
54+
regardless of the runtime provided the runtime has the minimum support required
55+
by the library.
5656

5757
# Getting Started
5858

5959
If you are migrating from the legacy nats.deno or nats.js or nats.ws clients
60-
don't despair. Changes are very easy to on-board, and are all
61-
[described here](migration.md).
60+
don't despair. Changes are well documented and should be easy to locate and
61+
implement, and are all [described here](migration.md).
6262

6363
If you want to get started with NATS the best starting point is the transport
6464
that matches the runtime you want to use:
@@ -69,7 +69,8 @@ that matches the runtime you want to use:
6969
The module for the transport will tell you how to install it, and how to use it.
7070

7171
If you want to write a library that uses NATS under the cover, your starting
72-
point is likely [Core](core/README.md). If data oriented it may be JetStream.
72+
point is likely [Core](core/README.md). If data oriented, it may be
73+
[JetStream](jetstream/README.md).
7374

7475
## Documentation
7576

0 commit comments

Comments
 (0)