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

New architecture for record translator #5751

Closed
92 of 137 tasks
wszymanski opened this issue Jan 31, 2019 · 12 comments
Closed
92 of 137 tasks

New architecture for record translator #5751

wszymanski opened this issue Jan 31, 2019 · 12 comments

Comments

@wszymanski
Copy link
Contributor

wszymanski commented Jan 31, 2019

Edited by: @wojciechczerniak

Context

WIP

Breaking changes

  • modifyRow, modifyCol, unmodifyRow and unmodifyCol will be removed
  • manualColumnFreeze will no longer enable manualColumnMove plugin and will work a liitle bit different.
  • collapsibleColumns will no longer enable hiddenColumns plugins
  • nestedRows will no longer enable trimRows plugin
  • filters will no longer enable trimRows plugin
  • observeChanges plugin won't be enabled by columnSorting and is from now deprecated
  • skipLengthCache hook was removed
  • Modifying data by reference and running render() does not work as it used to, because index mappers will not count this line. All operations must be done via Api methods populateFromArray (when cells are not readOnly - more details about that) or setDataAtCell.
  • minSpareRows and minRows will ensure that number of visible rows is proper also when the TrimRows plugin is enabled.
  • toPhysicalRow / toPhysicalColumn / toVisualRow / toVisualColumn functions won't return non-nullable index for unpresent element anymore.
  • Arguments of the afterLoadData has been changed.
  • The ManualColumnFreeze plugin works in a different way.
  • The RecordTranslator object and plugin's t property which referenced to it have been removed.
  • Hooks after..., ie. afterLoadData, afterFilter, afterUnmergeCells are called just before a render call from now.
  • Modification of data stored in the table by reference won't be supported anymore.

For further explanations of changes please take a look at #5945.

Progress

State 1

  • Create mappers collections where they can be registered
  • Register and modify mappers through reference
  • All mappers in collection should be updated on remove, insert, loadData, etc.
    • Remove hooks from plugins
  • Stop using modifyRow and modifyCol hooks. Use recordTranslator instead.
    • undoRedo plugin
    • dateValidator validator
    • timeValidator validator
  • Create physicalCache in IndexMapper class (for O(1) get operations)
  • Local Hook to rebuild Cache on changes

Stage 2

Stage 3a

  • CollapsibleColumns should no longer use HiddenColumns plugin #6204 CollapsibleColumns should no longer use HiddenColumns plugin
  • Cleanup and Code Review
    • Review all TODO and FIXME comments
    • Remove all magic strings, set them as const
  • Write tests for all solved issues (related issues section bellow)
  • Create documentation for IndexMappers
    • Update all references to old modifyRow pipeline
    • Update custom plugin tutorial with info how to use IndexMappers
    • Check if all breaking changes are reflected in the docs
  • Deprecate observeChanges plugin in docs and in code (warning msg when enabled?)

Stage 3b (WIP by @budnix handsontable/dev-handsontable#130)

Releated issues

Fixed:

Regression:

None.

Currently tested:

Cell Meta

Moved to #6274

Not related to 5751

  1. Sorting passing logical index through afterChange event #1501 Sorting passing logical index through afterChange event
  2. #3941 Auto column size plugin doesn't work properly after setting maxRows (by updateSettings)
  3. Improper selection after insert column/row when mergeCells is enabled. #4897 Wrong selection after inserting a row / column with mergeCells plugin enabled - bug reproduced
  4. Wrong 3rd parameter return for the beforeRemoveRow hook #5100 Wrong 3rd parameter return for the beforeRemoveRow hook - documentation changed
  5. Changing data while in edit results in edit to wrong data #5270 Changing data while in edit results in edit to wrong data - additional error
  6. Overloaded pluginHookBucket because of updateSettings or loadData #5727 We shouldn't use interval to calculate cache length there was a disscusion
  7. Filtering results in blank rows #5208 Filtering results in blank rows - hot.getPlugin("Filters").filter() results
  8. ManualColumnMove dragging breaks after updateSettings() #6004 ManualColumnMove dragging breaks after updateSettings()
  9. Rendering issue on column udpate with updateSettings #3770 Rendering issue on column udpate
  10. When we enable filters we aren't able to add new rows while pasting data #5648 filters don't work with copyPaste when new row has to be created bug reproduced
  11. Sorting after filtering with minSpareRows set #5983 Sorting after filtering with minSpareRows set
  12. [7.1.0.+] We cannot move nested row to become the last one in the table #6067 We cannot move nested row to become the last one in the table
  13. Headers doesn’t export with exportToFile in the specific case  #4176 countSourceCols omits empty cells
  14. after remove columns get wrong sourceData with formulas enabled #5550 With enabled formulas the sourceData is not updated after remove column
  15. Issue with setDataAtRowProp() - bad column index translation #4118 Issue with setDataAtRowProp() - bad column index translation

Found and repaired immediately

After HiddenColumns

Moved to #6178

Checklist

  • Affected plugins:

    • trimRows
    • nestedRows
    • manualColumnFreeze / manualRowFreeze
    • filters
    • manualRowMove / manualColumnMove
    • hiddenRows / hiddenColumns
    • manualRowResize / manualColumnResize
    • autoRowResize / autoColumnResize
    • columnSorting / multipleColumnSorting
    • customBorders
    • collapsibleColumns
    • PersistantState
    • observeChanges in wrappers
  • Core functionalities:

    • updateSettings
      • What if I change columns property
      • What if columns is a function
      • Does it work with minSpareRows and minSpareCols
      • Does it work with minRows, minCols, maxRows, maxCols
    • copy, cut and paste
    • Cell validation
    • CRUD operations, insertCol, removeCol, insertRow, removeRow
      • Performance if we inser/remove 10 000 cols / rows vs Handsontable 7.1
      • Move rows between fixed top, fixed bottom and main overlays
      • Move columns between fixed left and main overlays
@wszymanski wszymanski added this to the January 2019 milestone Jan 31, 2019
@wszymanski wszymanski self-assigned this Jan 31, 2019
wszymanski added a commit that referenced this issue Jan 31, 2019
wszymanski added a commit that referenced this issue Feb 21, 2019
wszymanski added a commit that referenced this issue Feb 27, 2019
wszymanski added a commit that referenced this issue Mar 6, 2019
wszymanski added a commit that referenced this issue Mar 6, 2019
wszymanski added a commit that referenced this issue Mar 6, 2019
wszymanski added a commit that referenced this issue Mar 12, 2019
wszymanski added a commit that referenced this issue Nov 6, 2019
wszymanski added a commit that referenced this issue Nov 6, 2019
@aaronbeall
Copy link
Contributor

Just want to say: I've been watching progress on this issue and the work is really impressive. The number of fixed issues are astounding. It's rare (in my experience) to see such a foundational refactoring come out alive. :)

@wojciechczerniak
Copy link
Contributor

Thanks @aaronbeall ! We took our experience with the product from recent years, feedback from you and other developers, and decided to put it into good use. More is coming after this refactor. We're not done yet 😄

wszymanski added a commit that referenced this issue Nov 7, 2019
mrpiotr-dev pushed a commit that referenced this issue Nov 8, 2019
* Index mapper test updated #5751

* Refactor #5751

* One case related to column sorting works from now #5751

* Draft of list structure change #5751

* Fix for trimRows plugin #5751

* Refactor #5751

* Next refactor #5751

* WIP: Next refactor with another kind of `indexMap` #5751

* Refactor #5751

* Filters rewritten to use index mappers #5751

* Removed unnecessary parts of code #5751

* Fix for emptyRows, emptyCols, minRows, minCols etc. #5751

* WIP: Two collections for index / value mappers #5751

* Missing change for different type of skip maps #5751

* Fix for filters #5751

* Next refactor #5751

* Fix for clear index  map function #5751

* Missing changes #5751

* Fix for manualRowMove #5751

* WIP: Added cache #5751

* Refactor #5751

* Small refactor #5751

* Next refactor #5751

* Changed some names of functions #5751

* Refactor #5751

* Changes after CR #5751

* Removed unnecessary files #5751

* Removed `skipLengthCache` hook and removed one helper #5751

* Removed next unnecessary helper #5751

* Performance optimization for `getVisualIndex` function by @wojciechczerniak proposition #5751

* New properties in base plugin class, removed copying array values for purposes of no mutation (performance) #5751

* Internal maps elements initialized as array of PACKED_SMI_ELEMENTS type #5751

* Fix for last change #5751

* Next performance improvement by @wojciechczerniak proposition #5751

* Fix for `minSpareRows` and `minRows`: trimmed rows block their influence on the table #5751

* Missing changes from `feature/issue-5068` branch customized to the actual code #5751

* Missing change #5751

* The `manualColumnMove` changes which are needed for plugin work at init and by `updateSettings` calls #5751

* ManualColumnFreeze plugin adapted to index mappers partially #5751

* Small refactor #5751

* WIP: New architecture for purpose of handling the `BindRowWithHeaders` plugin and similar needs #5751

* Refactor for the `BindRowsWithHeaders` plugin #5751

* Architecture reverted #5751

* Removed unnecessary file #5751

* Fix for moving indexes #5751

* ManualColumnMove rewritten partially - without undoRedo #5751

* Tests for manualColumnMove & fix for undoRedo #5751

* Missing changes for tests #5751

* Missing changes in manualColumnMove tests #5751

* Removed unndecessary files #5751

* Small fixes for the NestedRows plugin #5751

* Small refactor of the ColumnSummary plugin #5751

* Removed unused flags and the ObserveChanges plugin from the ColumnSorting plugin #5751

* Missing `destroy` function for plugin using index mappers #5751

* WIP: Change for columnSorting - additional check for purpose of determining whether indexes state should be reverted from cache #5751

* Fix for the Filters plugin tests which use the ManualColumnMove plugin #5751

* Reverted some changes related to filtes #5751

* Changed two tests #5751

* Removed uncessarry file & small changes in docs #5751

* Removed unnecessary files #5751

* Updating index mapper after detecting change by the ObserveChanges plugin #5751

* Changed test and fix for trimRows #5751

* Fix for the ObserveChanges plugin #5751

* Fixed two tests - one related with change in Core #5751

* Fix for one test #5751

* Initializing maps beeing part of index mapper also on registration #5751

* Extra tests & bigger dataset for tests & changed tests for bigger dataset #5751

* Extra test for one moving case #5751

* Proposition of change related with fix to the ColumnSummarry test #5751

* Refactor related with reverting work of `nestedRows` plugin before changes inside the `manualRowMove` plugin #5751

* WIP: Remove dependency `TrimRows` from the `NestedRows` plugin #5751

* Changed tests to meet new criteria #5751

* Fix for one test #5751

* Changed tests for the `ManualRowMove` and the `ManualColumnMove` to meet new criteria #5751

* Unregister mappers in the `disablePlugin` method #5751

* Change test related with the `ManualColumnMove` plugin to meet new criteria #5751

* Reverted part of functionality #5751

* Clearing information in local map after unfreeze operation #5751

* Restored part of functionality to the plugin #5751

* Breaking change: column is placed at the first position after frozen columns when unfixing #5751

* Missing change #5751

* Reverted dist files from the develop #5751

* Reverted .css file from develop

* Try of revert again #5751

* Fix for lnter & removed unnecessary part of CSS file #5751

* Cache for the ColumnSorting plugin implemented using map structure from index mapper #5751

* Introduced batching operations & change inside index mapper related with other way of setting cache on initialization #5751

* Fix for init function on single index map, removing possibility to exceed max call stack size #5751

* Added hooks for index mappers #5751

* Added some batched operations and removed another ones #5751

* WIP: Proposition for checking if any change was appied inside batch of operations #5751

* Moved attaching hook to the proper place - memory leak #5751

* Refactored updating cache  #5751

* WIP: Proposition of setting batch operations on instance #5751

* Polished structure of index mappers in context of batching operations #5751

* Small change - init hook is triggered after updating cache

* Batching operations for rest of plugins & removed initialization of index mapper by array #5751

* Set function to private #5751

* Proposition of changes inside API #5751

* Removed functions after discussion & fix for bindRowsWithHeaders #5751

* Missing change #5751

* Refactor ManualRowResize to be compatible with upcoming IndexMappers (#6166)

* Refactor ManualRowResize to be compatible with upcoming IndexMappers. #6164

* Changed: properties description and name correction. #6164

* Changed: ValueMap's name is a plugin's name in camel-case. #6164

* Extra unit tests for index mappers & change inside registration #5751

* Added batching operations #5751

* Refactor ManualColumnResize to be compatible with upcoming IndexMappers (#6165)

* Refactor ManualColumnResize to be compatible with upcoming IndexMappers. #6163

* Removed: out-dated comment in code. #6163

* Changed: renamed ValueMap const. #6163

* Changed: valuemap's name by camelCase indead of PascalCase. #6163'

* Added batching operations to next plugin #5751

* Moved tests from #5068 #5751

* Tests for single maps #5751

* Missing changes #5751

* Small refactor & tests #5751

* Added test for checking memory leak #5751

* Added test for checking memory leak & changed way how indexMap and valueMap are initialized #5751

* Extra tests for removing indexes #5751

* Refactor of inserting indexes & extra tests #5751

* Extra tests for inserting indexes when there are skipped indexes #5751

* Extra test for re-indexing skipped indexes after insertion #5751

* Part of changes after CR #5751

* Small refactor #5751

* Extra tests for sticking inserted indexes to the next adjacent element #5751

* Changed work of index mapper moving function & extra tests #5751

* Refactor AutoColumnSize to be compatible with upcoming IndexMappers (#6171)

* Refactor AutoColumnSize to be compatible with upcoming IndexMappers. #6169

* Changed: AutocompleteEditor doesn't need to use AutoColumnSize widths cache to correct its width for matched query 🎉 AutoColumnSize uses the same namespace in IndexMappers. #6169

* Changed: using physical indexes in columns width calculations. #6169

* Small refactor #6169

* Fix for tests #6169

* Changed implementation of move - it simulate now removing item and then inserting it on new position #5751

* WIP: changes with performance problem & code may be not complex enought for some use cases #5751

* Performance fix - caching number of columns in variable #5751

* Build files for jsDelivr #5751

* Build files for jsDelivr once again #5751

* Added missing feature #5751

* Fix for the problem with not rendering headers properly & breaking change for `minRows` and `minSpareRows` options & extra tests #5751

* Build files for jsDelivr once again #5751

* Fix for data insertion #5751

* Build files for jsDelivr once again #5751

* Missing tests for minSpareCols & minCols & startCols #5751

* Temporary fix for the PersistantState plugin in connection with the ManualRowMove plugin #5751

* Build files for jsDelivr once again #5751

* Temporary fix for the PersistantState plugin in connection with the ManualColumnMove plugin #5751

* Build files for jsDelivr once again #5751

* Extra tests for the BindRowsWithHeaders plugin #5751

* Fix for the PersistentState plugin in connection with ManualRowResize & ManualColumnResize #5751

* Build files for jsDelivr once again #5751

* Fix for bug #5751

* Build files for jsDelivr once again #5751

* Fix for the `loadData` function #5751

* Fix for bug - adding  UI elements to DOM after every loadData #5751

* Build files for jsDelivr once again #5751

* Fix for bug - adding  UI elements to DOM after every loadData - the ManualColumnMove plugin #5751

* Build files for jsDelivr once again #5751

* WIP: Tests for the NestedRows plugin #5751

* Fix for the #6066, but with not working selection #5751

* Fix for the selection #5751

* WIP: Fix for the NestedRows without passing all tests #5751

* Fixed tests #5751

* Build files for jsDelivr once again #5751

* Fix for the NestedRows plugin #5751

* Fix for the ColumnSummary plugin #5751

* Build files for jsDelivr once again #5751

* Fix for a regression in the NestedRows plugin #6320 #5751

* Build files for jsDelivr once again #5751

* Fix for the AutoColumnSize plugin - they will keep column sizes #5751

* Build files for jsDelivr once again #5751

* Proposition of change for #6322 #5751

* Small change #6322 #5751

* Build files for jsDelivr once again #6322 #5751

* Refactor - added beforeLoadData hook #5751

* Extra test for #3809 issue #5751

* Fix for two not passing unit tests #5751

* Extra test for #3937 issue #5751

* Extra test for #4204 issue #5751

* Extra test for #4442 (GL#186) issue #5751

* Extra test for #4470 issue #5751

* Extra test for #5707 issue #5751

* Extra test for #5889 issue #5751

* Extra test for #5890 issue #5751

* Extra test for #3937 issue #5751

* Extra test for #5931 issue #5751

* Extra test for #5244 issue #5751

* Extra test for #5874 issue #5751

* Extra test for #5900 issue #5751

* Added extra unit tests #5751

* Extra tests for cache managment for index mappers #5751

* Changed mechanism of calling hook when there is no real change #5751

* Change in the ColumnSummary plugin #5751

* Build files for jsDelivr once again #5751

* Small fix for tests related to the ColumnSummary plugin #5751

* Unification of calls to the index mapper inside plugins #5751

* Small improvments #5751

* Small refactor & changed a way how the afterLoadData hook is called & extra docs #5751

* Missing declarations in the .ts file #5751

* Proposition for unifying calls to record translator & removed some functions and plugin property #5751

* Removed record translator from the Handsontable instance #5751

* Documentation for the index mappers #5751

* Removed the `modify...` and `unmodify...` hooks #5751

* Removed record translator #5751

* Build files for jsDelivr once again #5751

* Fix for the `ManualColumnFreeze` plugin & small unit test adjustment #5751

* Build files for jsDelivr once again #5751

* Change for the `ManualColumnResize` plugin - prepared new code to be compatible with already existing workaround #5751

* Build files for jsDelivr once again #5751

* Changes in documentation after CR #5751

* Small change in docs #5751

* Removed left (un)modify(Row/Col) hooks #5751

* Refactor AutoRowSize to be compatible with upcoming IndexMappers (#6173)

* WIP. Refactor AutoRowSize to be compatible with upcoming IndexMappers. #6170

* Changed: no more references between manualRowResize and autoRowSize. #6170

* Removed: unnecessary code line. #6170

* Refactor #5751

* Decreased intervals to be compatible with the #develop branch #5751

* Extra test before changes #6170

* Revert & commited proper test #6170

* Fix for not passing tests #6170

* Extra batch for AutoRowSize plugin #5751

* Removed getters from the instance #5751

* Broader description of the `executeBatchOperations` functionality & renamed parameter #5751

* Refactor after CR #5751

* Typoes and missing TS test

* Removing unnecessary parameter in the function #5751

* Moved `render` calls after `after...` like hooks #5751

* Changed docs in the whole project #5751

* Missing docs #5751

* Small fix & added extra tests

* Build files for jsDelivr once again #5751

* Fix for data alter - now it should be positioned at a proper place #5751

* Build files for jsDelivr once again #5751

* Changing just names of variables #5751

* Refactored the `colToProp` function #5751

* Refactored the `propToCol` function #5751

* Build files for jsDelivr once again #5751

* Fix for not updating index mapper on the undoRedo (just sequence of indexes was changed) #5751

* Build files for jsDelivr once again #5751

* Fix for the #6412 #5751

* Build files for jsDelivr once again #5751

* Added extra tests for index mapper cache update & refactored code #5751

* Changed names for some properties & function arguments #5751

* Refactored names of index maps & updated description #5751

* Updated documentation & refactor #5751

* Updated comments line length #5751

* Missing changes #5751

* Missing TS definitions & documentation #5751

* TS methods test #5751

* Fix for the #6428 and height of row which was counted as negative #5751

* Build files for jsDelivr once again #5751

* WIP: Two more tests passing, but also as a consequence one is not passing #5751

* Build files for jsDelivr once again #5751

* Changed: manualRowResize plugin has to be imported before autoRowSize - otherwise, the same row has a different height in each overlay
@wojciechczerniak wojciechczerniak mentioned this issue Nov 13, 2019
204 tasks
wszymanski added a commit that referenced this issue Nov 14, 2019
wszymanski added a commit that referenced this issue Nov 14, 2019
wszymanski added a commit that referenced this issue Nov 14, 2019
wszymanski pushed a commit that referenced this issue Nov 14, 2019
wszymanski added a commit that referenced this issue Nov 14, 2019
wszymanski added a commit that referenced this issue Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants