Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit 02ee2b9

Browse files
GorashGoaman
authored andcommitted
[IMP] Core/Memory: remove one indentation in tests
1 parent 62dcd7e commit 02ee2b9

File tree

2 files changed

+2671
-2640
lines changed

2 files changed

+2671
-2640
lines changed

doc/technical_choices.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
2+
# The diff strategy
3+
4+
## The simple strategy vs diff strategy
5+
It would be simple to make the change in our API, then change the related nodes
6+
in the DOM. But there is some problems that we need to address.
7+
8+
So rather than 2 steps (direct strategy):
9+
1) apply in VDOC
10+
2) apply in DOM
11+
12+
We do 4 steps (diff strategy):
13+
1) apply in DOM
14+
2) apply in VDOC
15+
3) diff DOM-VDOC
16+
4) apply in DOM
17+
18+
### Problem 1: Dictionnary and spell checkers
19+
When preventing an event, if the dictionnary was saving data, it does not clear
20+
it's internal memory. So when another event happen, the dictionnary has wrong
21+
data and might create strange correction.
22+
23+
[provide examples]
24+
25+
### Problem 2: Mouvement between words
26+
When you have a word and you hit `ctrl + arrow`, you want to move from one word
27+
to the other. In some language like Lao, the words might not be separated by
28+
spaces. In order to know where is the delimitation of the word, we allow the
29+
browser to move the cursor and we reflect that navigation change in our VDOC.
30+
31+
### Problem of the diff strategy
32+
Because we need the event to happen in the DOM it is possible that our VDOC will
33+
have a different rendering then what the browser registred. In such case, glitch
34+
can occurs.
35+
36+
[Provide gif images to show a glitch]
37+
38+
### Exceptions
39+
It is possible in some case to be sure that there is no dictionnary/spell cheker
40+
running or that we can predict the movement of the words. In such case, we
41+
can use the browser `event.preventDefault()` and therfore avoid any possible
42+
glitch.
43+
44+
### Alternatives
45+
Ckeditor: deactivate the spellcheck alltogether and use third party plugins.
46+
47+
Quilljs: ?
48+
49+

0 commit comments

Comments
 (0)