-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Review DOM diffing/patching techniques #583
Comments
assigning this issue to @hardik-pratap-singh |
I want to work on this issue. |
|
Fix for 2nd checkpoint : PR #596 |
|
|
Approach for finding empty/false text nodes :Need of doing it ? They are giving some unwanted results like injecting icons across same slur word multiple times and also if we remove these text nodes we will not have to check for slurWords inside them later. Approach : Empty text nodes will look something like this :
|
Implemented this function following the approach described above PS : Results of Adding this function Earlier, for the same HTML page, we were getting total 31 responses as textNodes (including false textNodes) But after removing false textNodes, we are getting 8 responses as textNodes, (now we need to check for slurWords in these 8 textNodes instead of checking in those 31 textNodes including empty textNodes as well) |
Pre Requisite Knowledge
Deliverables
|
From our call, we know that @hardik-pratap-singh has some version of
|
Confirmation on the Design of Data Structure :
|
@hardik-pratap-singh looks good to me. You can proceed. |
Update on
|
@aatmanvaidya this looks good to me. Should we start moving the |
@dennyabrain sounds good to me, |
We don't have to think of this as a blocker since we will only be adding the functions, we won't be adding any code that uses these functions. So it should not be a problem. I'll let you take a final call though. |
got it, let's merge the function's then, going ahead, if things get too clogged up here, or we feel that this could be a new module, then we can move things to a new file, does that work? |
Yeah sounds good to me. |
Hello @dennyabrain @aatmanvaidya, As per the discussions, I am adding the functions However, I have commented the function calls and log statements for now. |
Hi @hardik-pratap-singh have reviewed and added few comments on the PR |
Hello @aatmanvaidya, I can't find your comments on the PR |
hi @hardik-pratap-singh , just above this you will find reviews added by me, something like this by comment I meant, reviews added to the code |
@aatmanvaidya actually above it, I have my PR. Can you please link it here ? |
I have added the changes to that PR only - can you try doing a hard refresh of the page? strange why its not visible - I have added comments to this PR itself - #597 |
I think it should not be the case that you have approved the changes that's why it is not visible |
could be, don't know why that's happening, |
Choose any webpage and save it's html in a file. Try to pick a webpage that has a good mix of different html elements.
Let's try to work on DOM parsing and creating data structures that are suited for our use case.
Remember, we want to optimise for following functions
Review the source code of a commonly used dom diffing library -
morphdom
https://github.com/patrick-steele-idem/morphdom
Also the TreeWalker (https://developer.mozilla.org/en-US/docs/Web/API/TreeWalker), which is natively available in browser as well.
These two will help you understand common approaches to dom parsing and refresh any data structure or algorithm knowledge you will need for this task.
As your deliverable, try writing an implementation, however naive and inefficient. We will use that as a starting point for critiquing and refining
The text was updated successfully, but these errors were encountered: