At a technical level I think this is a great idea. Some of the things
you've suggested we've already done. (The hard-to-write OT code will
absolutely be shared between projects). And as you say, the driver API
was very explicitly designed that way so drivers can live in their own
modules. I only held off on doing this while the API was in rapid flux
- but its settled down now. Having a simpler API to setup the whole
thing would great. The levelup, leveldown and level packages are nice
example of this model.
But all that said there's two reasons why I don't want to go down that road.
The first reason is complexity - there's an awful lot of code in the
current stack which only makes sense for JSON documents. Take a look
at the client document class in both 0.6 and master:
https://github.com/share/ShareJS/blob/0.6/src/client/doc.coffee - 330
lines of code
https://github.com/share/ShareJS/blob/master/lib/client/doc.js - 1030
lines of code (!)
Most of that extra code is needed for things like queries, operation
shattering and rejecting ops - features which are only needed for JSON
documents. I care a lot about implementation complexity than most
people (certainly more than Nate does). I'd rather make a minimal
library than a big library which covers every use case. This is just
my personal taste.
The second reason is that I'm moving to europe and starting a business
next year. Nobody pays me to work on this stuff, and it would burn too
much of my runway to get the current version of sharejs into a state
where I'm happy with it. Thankfully I don't have to - by handing over
the reins of the project to Nate + team, I know it'll be in good
hands. And I know they care about the features which are important to
this use case - their business depends on it.
As I say - I really like the changes you're suggesting. But there's no
reason we can't do both. Maybe talk to Nate about doing those changes
in sharedb anyway. If sharedb grows to do everything the little
sharejs library does but better, that wouldn't be a failure at all.
-J
On Fri, Oct 9, 2015 at 3:55 AM, Devon Govett <
devon...@gmail.com> wrote:
> Hi Joseph,
>
> I’m not sure I see the purpose of splitting the project in two. It seems
> like a huge duplication of effort when the projects will have so much in
> common. 0.7 already does support your use case for the new ShareJS project
> (collaborative text editing) along with support for any other OT type you
> might come up with. So I’m not sure why you think 0.7 has failed in creating
> a unified library. If it’s because you’re not happy with the code, then
> let’s make it better rather than forking completely. If it’s because you
> think it’s too hard to set up a simple collaborative text editing system,
> then let’s create a small library on top of the current ShareJS/LiveDB which
> hooks everything up for you easily (db + text type etc.).
>
> If you really think we should fork, I’ll suggest what I said the last time
> this came up which is that rather than starting from scratch and having so
> much duplication of functionality, we should find a new common baseline for
> the projects to both sit on, so that they both can benefit from
> enhancements. Let’s start from 0.7 and abstract out and modularize various
> pieces that are currently built into sharejs and livedb and make the
> projects more extendible. Then you could easily build simpler wrappers on
> top to hide the complexity from users that wanted to get up and running
> quickly.
>
> Here’s what I said before:
>
> I think, if there are going to be two separate projects going forward, it
> would be best for everyone involved if as much code as possible could be
> shared between the projects. For example, the direction of moving the OT
> types out of ShareJS into their own modules is a good start. If the two
> projects could share that code, it would be awesome. Additionally, the
> networking stuff (client-server protocol) seems like it could be shared as
> well. The backend for transforming ops and saving them to a database could
> also be common.
>
> Come to think of it, I actually think it may be better to start from the
> current ShareJS and livedb and make them more modular rather than splitting
> the project entirely in two. Move the redis and in process driver stuff from
> livedb into separate modules that can be plugged in. Move the memory store
> into a separate module, like livedb-mongo is. Move the query stuff into a
> separate plugin as well, for both ShareJS and livedb. Move the rest server
> out of ShareJS and into a separate module. Same for projections. Cursor
> support could also be added as a plugin, configurable to support whatever OT
> type you’re using (e.g. text or JSON), or even separate modules for each.
>
> ShareJS would end up being just the client and server of the basic network
> protocol, only supporting fetching and subscribing to documents, and
> submitting ops via livedb. The protocol could be extendible so that other
> things could be added, such as queries, projections, and cursors. Users
> could use browserify to build the ShareJS client and each plugin they need
> in their application. Livedb would become just the basis of an OT backend,
> with support for multiple plugins for databases and drivers (already almost
> there). Out of the box it couldn’t do anything by itself - you’d need to add
> a backend and a driver at the minimum. It could be made just a bit more
> extendible to support things like queries and projections as well.
>
> This looks like a lot when I write it out, but I think we’re already pretty
> close to what I described, at least on the livedb side (drivers and backends
> are already basically plugins). If we went with this modular design, and you
> wanted to build your small text editing library, you’d just require livedb
> with an in process driver and whatever backend you wanted, the ShareJS
> client/server, a plain text or rich text OT type, and cursor support. It
> would end up lighter weight than currently since you wouldn’t require
> anything you don’t need (e.g. JSON OT, redis, queries, and projections). You
> could even publish this as a module for others to use with zero
> configuration (and also a good example for people who want to build their
> own config).
>
>
> Like I said before, I’m happy to help with this. I think sharing as much
> code as possible will be better for everyone in the long run.
>
> Devon
> --
> You received this message because you are subscribed to the Google Groups
> "ShareJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sharejs+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "ShareJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to
sharejs+u...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.