@unsetsoft/ryunixjs 1.0.3-nightly.5 → 1.0.3-nightly.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Ryunix.js +5 -2
- package/package.json +1 -1
- package/src/lib/commits.js +2 -0
- package/src/lib/dom.js +1 -2
- package/src/lib/render.js +1 -0
- package/src/lib/workers.js +1 -0
package/dist/Ryunix.js
CHANGED
|
@@ -165,14 +165,13 @@
|
|
|
165
165
|
* @returns A newly created DOM element based on the fiber object.
|
|
166
166
|
*/
|
|
167
167
|
const createDom = (fiber) => {
|
|
168
|
+
console.log('Creating DOM element for fiber:', fiber);
|
|
168
169
|
const dom =
|
|
169
170
|
fiber.type === RYUNIX_TYPES.TEXT_ELEMENT
|
|
170
171
|
? document.createTextNode('')
|
|
171
172
|
: document.createElement(fiber.type);
|
|
172
173
|
|
|
173
|
-
// Update the newly created DOM element with initial props
|
|
174
174
|
updateDom(dom, {}, fiber.props);
|
|
175
|
-
|
|
176
175
|
return dom
|
|
177
176
|
};
|
|
178
177
|
|
|
@@ -278,8 +277,10 @@
|
|
|
278
277
|
* The function commits changes made to the virtual DOM to the actual DOM.
|
|
279
278
|
*/
|
|
280
279
|
const commitRoot = () => {
|
|
280
|
+
console.log('Committing root...');
|
|
281
281
|
vars.deletions.forEach(commitWork);
|
|
282
282
|
if (vars.wipRoot && vars.wipRoot.child) {
|
|
283
|
+
console.log('Committing child...');
|
|
283
284
|
commitWork(vars.wipRoot.child);
|
|
284
285
|
vars.currentRoot = vars.wipRoot;
|
|
285
286
|
}
|
|
@@ -526,6 +527,7 @@
|
|
|
526
527
|
* @returns {null} The next fiber to process, or undefined if there are no more.
|
|
527
528
|
*/
|
|
528
529
|
const performUnitOfWork = (fiber) => {
|
|
530
|
+
console.log('Performing unit of work for fiber:', fiber);
|
|
529
531
|
const isFunctionComponent = fiber.type instanceof Function;
|
|
530
532
|
isFunctionComponent
|
|
531
533
|
? updateFunctionComponent(fiber)
|
|
@@ -573,6 +575,7 @@
|
|
|
573
575
|
console.error(`Root element with ID '${rootId}' not found.`);
|
|
574
576
|
return null
|
|
575
577
|
}
|
|
578
|
+
console.log('Container initialized:', vars.containerRoot);
|
|
576
579
|
|
|
577
580
|
vars.containerRoot = rootElement;
|
|
578
581
|
return undefined
|
package/package.json
CHANGED
package/src/lib/commits.js
CHANGED
|
@@ -6,8 +6,10 @@ import { EFFECT_TAGS, vars } from '../utils/index'
|
|
|
6
6
|
* The function commits changes made to the virtual DOM to the actual DOM.
|
|
7
7
|
*/
|
|
8
8
|
const commitRoot = () => {
|
|
9
|
+
console.log('Committing root...')
|
|
9
10
|
vars.deletions.forEach(commitWork)
|
|
10
11
|
if (vars.wipRoot && vars.wipRoot.child) {
|
|
12
|
+
console.log('Committing child...')
|
|
11
13
|
commitWork(vars.wipRoot.child)
|
|
12
14
|
vars.currentRoot = vars.wipRoot
|
|
13
15
|
}
|
package/src/lib/dom.js
CHANGED
|
@@ -14,14 +14,13 @@ import {
|
|
|
14
14
|
* @returns A newly created DOM element based on the fiber object.
|
|
15
15
|
*/
|
|
16
16
|
const createDom = (fiber) => {
|
|
17
|
+
console.log('Creating DOM element for fiber:', fiber)
|
|
17
18
|
const dom =
|
|
18
19
|
fiber.type === RYUNIX_TYPES.TEXT_ELEMENT
|
|
19
20
|
? document.createTextNode('')
|
|
20
21
|
: document.createElement(fiber.type)
|
|
21
22
|
|
|
22
|
-
// Update the newly created DOM element with initial props
|
|
23
23
|
updateDom(dom, {}, fiber.props)
|
|
24
|
-
|
|
25
24
|
return dom
|
|
26
25
|
}
|
|
27
26
|
|
package/src/lib/render.js
CHANGED
package/src/lib/workers.js
CHANGED
|
@@ -32,6 +32,7 @@ requestIdleCallback(workLoop)
|
|
|
32
32
|
* @returns {null} The next fiber to process, or undefined if there are no more.
|
|
33
33
|
*/
|
|
34
34
|
const performUnitOfWork = (fiber) => {
|
|
35
|
+
console.log('Performing unit of work for fiber:', fiber)
|
|
35
36
|
const isFunctionComponent = fiber.type instanceof Function
|
|
36
37
|
isFunctionComponent
|
|
37
38
|
? updateFunctionComponent(fiber)
|