Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(layered-storage): add a new storage for options #71

Draft
wants to merge 54 commits into
base: master
Choose a base branch
from

Commits on Jan 26, 2020

  1. feat(layered-storage): add a new storage for options

    This is intended to replace the prototype plus hacks insanity used at
    the moment. However this is still WIP. There is no documentations yet
    and more testing is necessary.
    
    TODO:
    - Add off.
    - Write docs.
    - Probably some other things too.
    
    In a quick test I was able to resolve the issue discussed in
    visjs/vis-network#178 and visjs/vis-network#213 with just a few lines of
    code. Which is much better than the massive mess of weird hacks that
    doesn't work reliably anyway.
    
    Putting this to use will be a lot of work but fortunately it should be
    possible to do it in parts. I would first use this in LayoutEngine and
    EdgesHandler to resolve the forementioned issues and then probably one
    module at the time.
    
    Features:
    - Encapsulates options merging.
    - Explicit layer/segment/key structure instead of prototype chains.
    - Observable.
    - Overrides. *
    - Type safety in TypeScript.
    
    * Hierarchical layout is incompatible with smooth edges and has to
    disable them. Overrides combined with observing easily and elegently
    solve that. See the forementioned issues for current state.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    d4476da View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    285977d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4b49dc1 View commit details
    Browse the repository at this point in the history
  4. docs(layered-storage): add yet more docs

    About half should be done by now.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    9fb537a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    357b951 View commit details
    Browse the repository at this point in the history
  6. style(layered-storage): rename revert to abort

    It makes more sense given what it actually does.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    353f220 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    47bfa2f View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    bfb7012 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    b2f0408 View commit details
    Browse the repository at this point in the history
  10. fix(layered-storage): cache the values when accessed

    Caching up front would be too complex to implement properly without
    rebuilding the whole cache due to every change.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    85ea039 View commit details
    Browse the repository at this point in the history
  11. fix(layered-storage): throw for nonnumeric layers

    The sorting fails and TS already prohibits them. There's no indisputable
    way of sorting nonnumbers anyway.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    e5d429c View commit details
    Browse the repository at this point in the history
  12. feat(layered-storage): add console dump method

    This is to simplify debugging. It logs the content of the storage to the
    console using collased groups to denote the structure of the storage.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    689c154 View commit details
    Browse the repository at this point in the history
  13. fix(layered-storage): purge empty structures

    Previously the structures were kept even if all values were deleted.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    b6f13b8 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    7c4350c View commit details
    Browse the repository at this point in the history
  15. style: fix linting issues

    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    d9eb64c View commit details
    Browse the repository at this point in the history
  16. feat(layered-storage): remove events

    BREAKING CHANGE: The on methods were removed from Layered Storage.
    
    This was unbearably slow. Most of the time was actually spent handling
    events. Making it faster without reducing it's functionality to the same
    level as Emitter seems impossible to me. Since we already use the
    Emitter there's no point in having such thing.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    de132b4 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    24beaa2 View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    b1787b8 View commit details
    Browse the repository at this point in the history
  19. perf(layered-storage): do not clean unaffacted cache

    Prior to this all cache for given key was cleaned on set or delete.
    However this is only necessary for monolithic segment. Other segments
    can't affect anything but themselves so it's okay to keep the other
    segments cached.
    
    This greatly improves set and delete performance.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    b64c4fd View commit details
    Browse the repository at this point in the history
  20. perf(layered-storage): cache nonexistent values too

    This greatly improves performance on mostly static data as it avoids
    repeated traversing through the data just to find nothing over and over
    again.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    4bf2f3a View commit details
    Browse the repository at this point in the history
  21. perf(layered-storage): iterate over cache when clearing it

    Before this all segments were iterated over and then checked for
    existence. This is faster as it iterates only over existing cache
    without checking for each segment's cache existence and also less code.
    
    Also includes a test for possible regression that was unchecked before.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    80f189c View commit details
    Browse the repository at this point in the history
  22. feat(layered-storage): add expanders

    These are used to expand short hand values to their full forms.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    e87368a View commit details
    Browse the repository at this point in the history
  23. feat(layered-storage): unify validator and expander API

    BREAKING CHANGE: addValidators no longer exists
    
    Appending validators to already existing one is most likely an error. At
    least in Vis Network I see no reason to do it. Therefore it makes more
    sense to throw in such a case.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    1ca06e1 View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    1fed169 View commit details
    Browse the repository at this point in the history
  25. fix(layered-storage): use entries instead of pair

    BREAKING CHANGE: Some types were renamed.
    
    It has the same format as the various .entries() methods so it makes
    more sense to call it entries.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    b9b559c View commit details
    Browse the repository at this point in the history
  26. Configuration menu
    Copy the full SHA
    9d61fa2 View commit details
    Browse the repository at this point in the history
  27. Configuration menu
    Copy the full SHA
    84f4d27 View commit details
    Browse the repository at this point in the history
  28. perf(layered-storage): improve performance

    Those are a few micro optimalizations. However since this is executed
    over and over again it adds up to noticable improvement.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    093040f View commit details
    Browse the repository at this point in the history
  29. Configuration menu
    Copy the full SHA
    fd2a42e View commit details
    Browse the repository at this point in the history
  30. Configuration menu
    Copy the full SHA
    84a0144 View commit details
    Browse the repository at this point in the history
  31. feat(layered-storage): simplify

    BREAKING CHANGE: Most stuff was changed.
    
    This is a really big overhaul that greatly reduces the API and the
    codebase. This should be much easier to maintain and also more
    performant when used at the expense of removing support for some niche
    features.
    Thomaash committed Jan 26, 2020
    Configuration menu
    Copy the full SHA
    cc0f866 View commit details
    Browse the repository at this point in the history
  32. Configuration menu
    Copy the full SHA
    cc7e879 View commit details
    Browse the repository at this point in the history

Commits on May 24, 2020

  1. Configuration menu
    Copy the full SHA
    bf566ec View commit details
    Browse the repository at this point in the history
  2. style: reformat

    Thomaash committed May 24, 2020
    Configuration menu
    Copy the full SHA
    763c703 View commit details
    Browse the repository at this point in the history
  3. style: fix typo in config

    Thomaash committed May 24, 2020
    Configuration menu
    Copy the full SHA
    28a1240 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1153f4a View commit details
    Browse the repository at this point in the history
  5. feat(layered-storage): add export to object

    This will make integrating this into existing codebase much easier.
    We'll be able to mostly contain the changes into .setOptions() methods.
    Thomaash committed May 24, 2020
    Configuration menu
    Copy the full SHA
    41195bd View commit details
    Browse the repository at this point in the history
  6. fix(layered-storage): throw right away in transactions

    Prior to this only the commit would fail.
    Thomaash committed May 24, 2020
    Configuration menu
    Copy the full SHA
    6b3785b View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d229669 View commit details
    Browse the repository at this point in the history
  8. feat(layered-storage): add inheritance

    This can be used to implement groups from Vis Network. It actually
    allows for multiple groups per single node which is already a wanted
    feature that would be extremely difficult to implement using the
    (anti)pattern that's currently in Vis Network for options.
    Thomaash committed May 24, 2020
    Configuration menu
    Copy the full SHA
    d1c16b9 View commit details
    Browse the repository at this point in the history
  9. feat(layered-storage): add a basic library of validators

    This also includes a tweak to the way validating is done.
    Thomaash committed May 24, 2020
    Configuration menu
    Copy the full SHA
    10367bb View commit details
    Browse the repository at this point in the history

Commits on May 31, 2020

  1. feat(layered-storage)!: use sepparate input and output types

    BREAKING CHANGE: The types are different, though the code is pretty much
    the same on the outside.
    
    This allows for typesafe expanding of values or transforming them
    (expanders allow both at the same time).
    Thomaash committed May 31, 2020
    Configuration menu
    Copy the full SHA
    9175f38 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9089b80 View commit details
    Browse the repository at this point in the history
  3. feat(layered-storage)!: add DELETE keyword to delete values through set

    BREAKING CHANGE: This completely prevents null from being used as a
    value.
    
    We could change it to a symbol if this turns out to be a problem.
    Thomaash committed May 31, 2020
    Configuration menu
    Copy the full SHA
    fb0fc8b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ab56402 View commit details
    Browse the repository at this point in the history

Commits on Jun 1, 2020

  1. Configuration menu
    Copy the full SHA
    6c3c545 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2020

  1. Configuration menu
    Copy the full SHA
    3a4b9f2 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2020

  1. Configuration menu
    Copy the full SHA
    ab88903 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    edb0996 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4d41b96 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    81fd0c3 View commit details
    Browse the repository at this point in the history
  5. test: disable DTS testing for now

    Since it's not possible to use custom tsconfig.json it only works with
    what the authors configured it to work with. There's an issue on their
    repo tracking this.
    
    It doesn't work with layered storage because it uses iterables other
    than arrays and that's not configured in check-dts.
    Thomaash committed Aug 9, 2020
    Configuration menu
    Copy the full SHA
    15603e8 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    97deb9b View commit details
    Browse the repository at this point in the history

Commits on Aug 14, 2020

  1. Configuration menu
    Copy the full SHA
    501926e View commit details
    Browse the repository at this point in the history