Giter Site home page Giter Site logo

braidjs's Introduction

The Braidjs Monorepo

By versioning our code together, it becomes easier to interoperate.

  • Each top-level folder is a project. Add yours!
  • Now you can make breaking changes (like a protocol change), without actually breaking anything—upgrade all the relevant code, across multiple projects, at once!

This is not my code. This is our code.

Projects

Add yours today!

Read more about braid at https://braid.org!

Faq

Q. Wait... can a single repo support multiple NPM packages?

  • A. Yep! Just create a package.json in your project's root folder, and then run npm publish from it.

braidjs's People

Contributors

audreyfeldroy avatar canadaduane avatar dglittle avatar jakearmendariz avatar slickytail avatar tgrecojs avatar toomim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

braidjs's Issues

Elixir language support

What's a series of steps to get started on a compatible version of braid or antimatter in Elixir?

Looking for a step by step guide.

braid_fetch issue on Firefox

Hey everyone,
I think I found a bug in the braidify library regarding how subscription data is parsed on the client side.
On the client-side:
image

On the server-side:
image

Here is a snippet from braidify-client where the subscription starts getting parsed. res.body gets passed as a stream to the stream handler
Screenshot_20220316_174640

Inside the stream handler a new subscription_parser object is instantiated with the property state set to its default value { input: "" }.
The problem is that inside the parser the state.headers property is never defined so parse_version will try to parse headers from the input (res.body, which obviously doesn't contain header information).

image
image

Thus, if you look through the code there is no other place where the callback (passed to handle_fetch_stream, see first image) is called with result != null, besides when parser's state.result === success, which never happens because we can't parse header information from the body.

A quick fix is passing a subscription_parser object directly into handle_fetch_stream with state.headers defined to the res.header property. This is just the first idea that came into my mind, feel free to leave below a better solution.
I'll show my implementation here when I figure out how to push it to this issue :)

Edit1: was incomplete
Edit2: typo

looking for the code for the interact demo

Hi,

Very cool project!

I really liked the interactive demo on https://braid.org/demo/interact
I was looking for the code for it. In case it is available, I would be interested.

Thank you!

Not able to run the demo

Hello,

I was not able to run the demo from braid-http/demos/chat
is it up to date ?
I had to edit server.js +19 to var braidify = require('../blog3/braidify-server')
and even after that I got:
GET https://localhost:3009/chat net::ERR_CONNECTION_REFUSED errors in the console when browsing https://localhost:3009/

Documentation

We should update the readme and potentially provide better documentation all around.

Three insights on documentation that might be helpful here, taken from various communities:

  1. A (short) synopsis of the architecture can be helpful, even if the details aren't documented. This doesn't have to take a lot of time, and if short, can be changed easily as refactorings take place.

  2. Documentation has four quadrants: practical<->theoretical and studying<->working. In the early stages of a project, it can be useful to focus on the "Discussions" (theoretical/studying) quadrant in order to help others understand, but without the burden of writing or maintaining tutorials, references, or how-to guides.

  3. "How Docs vs. Why Docs". The key insight here is that "why" is slow to change, whereas "how" is an evolving target.

Developer UX: Requiring SSL on first-time local setup sucks

In Braid, we depend on keep-alive streams to keep state up-to-date on the client. Unfortunately, however, HTTP1.1 supports a paltry 6 simultaneous streams. This means we are limited to 6 state resources on HTTP1.1 using the current spec.

Since HTTP2 supports multiplexing any number of streams, it's natural to reach for HTTP2 as the solution; however, HTTP2 requires SSL. Therefore, when running on localhost, HTTP2 adds an additional layer of friction to a first-time developer experimenting with Braid: they must install a self-signed certificate and click past the "scare screen" in the browser.

Possible solutions:

  • Limit first-time demo apps to 6 state resources
  • Braid over Websocket
  • Multiplex resources over single stream
  • others?

Publish as NPM package

The last update was 8 months ago. We should publish the latest braidjs package.

We're looking for the best way to expose the braid protocol API. Currently, I'm thinking of the following two functions:

  1. fetch: (e.g. import { fetch } from 'braidjs') This is the braid-augmented "whatwg fetch" that we provide, allowing HTTP subscriptions and patches among other things. It works in browser & in nodejs.
  2. braidify: (e.g. import { braidify } from 'braidjs') This is the braid middleware on the server side that can be used, e.g. in express or polka.

Also, we'd like to make the package both es6 and commonjs compatible, so we need to consider how to package and export these in a way that works for both module systems.

Make Braidify work with binary payloads

@josephg mentioned that he tested his diamond-types on braid.org/test-a-server, and ran into an issue that test-a-server didn't support binary payloads. I don't think I've tested it with binary, and there are probably places where I'm assuming a string.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.