GithubHelp home page GithubHelp logo

0xtheprodev / operational-transformation Goto Github PK

View Code? Open in Web Editor NEW
45.0 1.0 11.0 1.59 MB

A collection of Algorithms to Synchronise changes across multiple clients using Operational Transformation

Home Page: https://ot.js.org

License: Other

JavaScript 3.37% TypeScript 96.22% Shell 0.41%
operational-transformation collaborative-editing monaco-editor eventual-consistency distributed-database typescript hacktoberfest firebase ace-editor

operational-transformation's Introduction

Operational Transformation

@otjs


Build Tests Deployment Code Quality Code Coverage

Sponsor Version Built With Tested With Typed With Styled With License Open Issues Closed Issues Open Pulls Closed Pulls Contributors Activity

Description

Collection of Operation Transformation Algorithms and their respective clients to integrate with any existing system.

Package Version Downloads Third-party Dependency
ace
firebase-ace
firebase-monaco
firebase-plaintext
monaco
plaintext -
plaintext-editor -
state-machine -
types - - -
utils - - -

Installation

This repository uses monorepo architecture for hosting packages. We are using Lerna to manage workspaces and publishing of individual packages, where as Pnpm is used as package manager to symlink and install External Dependencies.

  • To install using Pnpm (recommended):

    pnpm install -r
  • To install using Lerna:

    lerna bootstrap

Testing

We are using Jest extensively to form our Unit Test Suite as well as Integration Test Suites, along with test environment, stubs and test runner. Nyc (formerly known as Istanbul) is used for coverage reporting.

  • To run all the unit test suites in local dev environment, run the following after dependencies have been installed:

    pnpm test
  • To run unit tests in CI environment, run:

    pnpm test:ci
  • To run integration tests in CI environment, run:

    pnpm test:firebase
    pnpm test:monaco
  • To merge all the individual code coverage report and generate final test coverage report, run:

    pnpm run coverage
  • To convert generated final coverage report into more human readable form (such as lcov), run:

    pnpm run coverage:dev

Integration Tests

This package only provides a functional layer on top of your existing dependencies and does not ship any additional bundle. To make sure our implementation and integrations are up-to-date, we have a comprehensive set of Integration Test Suite living in tests directory.

Editor Integration

Most of the popular editors and IDEs have extensions to help with Code Coverage details. These tools often read lcov reports and not json format. So one must convert them into lcov using last command described above to make it work with the editor of their choice.

Metrics and Tracking

We are using codecov.io to track progress over Code Coverage and CodeQL for Code Quality Analysis.

Reporting a Bug

Head on to Discussion section to report a bug or to ask for any feature. Use this template to make it structural and helpful for the maintainer and the contributors. Feel to add your queries about using this library as well under Q & A section of it. Remember, do not create any Issues by yourself, maintainers of this repository will open one if deemed necessary.

Changelog

See CHANGELOG for more details.

Contributing

See Contributing Guidelines.

License

This project is licensed under the terms of the MIT license, see LICENSE for more details.

operational-transformation's People

Contributors

0xtheprodev avatar dependabot[bot] avatar lakbychance avatar satyamvats5 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

Watchers

 avatar

operational-transformation's Issues

Update aceContent implementation in TooltipMarker.ts

Discussed in #97

Originally posted by lakbychance October 20, 2021
https://github.com/Progyan1997/Operational-Transformation/blob/c743cc51648d544c1a783b66e0c81dc208e0e593/packages/ace/src/tooltip-marker.ts#L52

Hey @Progyan1997 , I thought about this code here and I feel that this piece of code works for now but depends on querySelector to retrieve the ace_content div. Instead of that I think we can shift this code inside the update method and use closest to append the tooltip marker like so :-

    if (!this._aceContent) {
      this._aceContent = markerLayer.element.closest('.ace_content');
      this._aceContent.append(this._tooltipWidget);
    }

where _aceContent is a new property on TooltipMarker class. We can also not introduce this new property and instead run the closest and append operation every time which will result in same behavior.

What do you think ? If you would wanna go with this, would you choose introducing _aceContent or performing closest and append every time ?

My intuition for this change - The reason is possible collision of same class names can break this with top to bottom existing approach. In bottom to top with closest the probability is very less unless user manipulates the editor DOM nodes itself.

Improve Quality of Documentation

Discussed in #63

Originally posted by lapstjup October 3, 2021
Hi @Progyan1997 , I was going through the CONTRIBUTING.md for this project and found subtle grammatical nuances that I think can be corrected. Also the README link in the same redirects to 404 Page. Since the guidelines state that an issue shouldn't be opened up by a user until a maintainer picks it from discussions and these kind of changes don't fall under bug report, can I proceed with creating an issue and submitting a PR that addresses it ?

BTW, this is a really cool project ๐Ÿ’ฏ . I haven't really worked in the same space so the code is new but interesting. I think a diagrammatic workflow would be good addition to README as well so that new comers can familiarize themselves quickly with terminologies like "Operational Transformation", "Editor Adapters" and "Database Adapters".

Out of Scope: Diagrams and further analysis.

Refactors on Adapter Packages

  • Rename Package names.
  • Split Current Test Suites into separate place.
  • Write Unit Tests.
  • Update Workflow to handle different test suites.

Add API for adding Announcement Duration for FireAce

Discussed in #82

Originally posted by lakbychance October 9, 2021
Hey @Progyan1997 , now that the remote tooltip implementation is done, the FireAceEditor constructor can accept announcementDuration as in FireMonacoEditor. So the change also has to go in @otjs/firebase-ace package. Plus README also has to be updated accordingly for both @otjs/ace and @otjs/firebase-ace. Can you raise an issue for the same ? TBH, I am not a fan of bugging the maintainers every time when raising an issue ๐Ÿค” .

License

Mention MIT License and add link to LICENSE for more details.

ETA for release of firebase-monaco?

@hackerrank/firepad-x is frozen at monaco 0.18.x as a peer dependency. I wish to upgrade to monaco 0.28.1 but it looks like a breaking change exists.

Contributing

Create CONTRIBUTING.md and CODE_OF_CONDUCT.md in .github and point to that in README.md.

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.