From c44071fe5c847032adbd0eb5ddccd061f7285def Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 21 Mar 2022 11:09:36 +1100 Subject: [PATCH 1/2] Rename Store JavaScript example --- examples/README.md | 2 +- examples/{unpkg-js-store => store-js}/README.md | 2 +- examples/{unpkg-js-store => store-js}/index.html | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename examples/{unpkg-js-store => store-js}/README.md (91%) rename examples/{unpkg-js-store => store-js}/index.html (100%) diff --git a/examples/README.md b/examples/README.md index 668f5aa62b..a41a7eb81e 100644 --- a/examples/README.md +++ b/examples/README.md @@ -12,6 +12,6 @@ Here is the list of the code examples and the features they demonstrate: Protobuf using `protons`, No async/await syntax. - [Minimal ReactJS Waku Store App](store-reactjs-chat): Waku Store, React/JavaScript, Protobuf using `protons`. -- [Pure Javascript Using Minified Library](unpkg-js-store): Stop retrieving results from Waku Store on condition, Use minified bundle from Unpkg.com, JavaScript. +- [Using Waku Store in JavaScript](store-js): Stop retrieving results from Waku Store on condition, Use minified bundle from Unpkg.com, JavaScript. See https://docs.wakuconnect.dev/docs/examples/ for more examples. diff --git a/examples/unpkg-js-store/README.md b/examples/store-js/README.md similarity index 91% rename from examples/unpkg-js-store/README.md rename to examples/store-js/README.md index 73e1525375..524c405bb8 100644 --- a/examples/unpkg-js-store/README.md +++ b/examples/store-js/README.md @@ -1,4 +1,4 @@ -# Pure Javascript Using Minified Library +# Using Waku Store in JavaScript **Demonstrates**: diff --git a/examples/unpkg-js-store/index.html b/examples/store-js/index.html similarity index 100% rename from examples/unpkg-js-store/index.html rename to examples/store-js/index.html From 98c1257585cab0daf26397e9b779c962ee53a891 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 21 Mar 2022 11:12:49 +1100 Subject: [PATCH 2/2] Add JavaScript Relay example --- CHANGELOG.md | 4 + examples/README.md | 1 + examples/relay-js/README.md | 11 +++ examples/relay-js/index.html | 163 +++++++++++++++++++++++++++++++++++ 4 files changed, 179 insertions(+) create mode 100644 examples/relay-js/README.md create mode 100644 examples/relay-js/index.html diff --git a/CHANGELOG.md b/CHANGELOG.md index d803588b37..6037082cb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Examples: Add Relay JavaScript example. + ## [0.19.2] - 2022-03-21 ### Fixed diff --git a/examples/README.md b/examples/README.md index a41a7eb81e..d7b29cc990 100644 --- a/examples/README.md +++ b/examples/README.md @@ -13,5 +13,6 @@ Here is the list of the code examples and the features they demonstrate: No async/await syntax. - [Minimal ReactJS Waku Store App](store-reactjs-chat): Waku Store, React/JavaScript, Protobuf using `protons`. - [Using Waku Store in JavaScript](store-js): Stop retrieving results from Waku Store on condition, Use minified bundle from Unpkg.com, JavaScript. +- [Using Waku Relay in JavaScript](relay-js): Receive and send text messages with Waku Relay, Use minified bundle from Unpkg.com, JavaScript. See https://docs.wakuconnect.dev/docs/examples/ for more examples. diff --git a/examples/relay-js/README.md b/examples/relay-js/README.md new file mode 100644 index 0000000000..c972622886 --- /dev/null +++ b/examples/relay-js/README.md @@ -0,0 +1,11 @@ +# Using Waku Relay in JavaScript + +**Demonstrates**: + +- Waku Relay: Send and receive messages using Waku Relay. +- Pure Javascript/HTML. +- Use minified bundle of js from unpkg.com, no import, no package manager. + +This example uses Waku Relay to send and receive simple text messages. + +To test the example, simply download the `index.html` file from this folder and open it in a browser. diff --git a/examples/relay-js/index.html b/examples/relay-js/index.html new file mode 100644 index 0000000000..b39276d53a --- /dev/null +++ b/examples/relay-js/index.html @@ -0,0 +1,163 @@ + + + + + + + JS-Waku Chat + + + + +

Waku Node Status

+
+ + + + +

Messages

+
+ + + + + + +