LearnNewsExamplesServices
Frontmatter
id1757
titlecontroller.Component: change the view parsing from a top down to a bottom up approach
stateClosed
labels
enhancement
assigneestobiu
createdAtApr 13, 2021, 4:12 PM
updatedAtApr 14, 2021, 5:05 PM
githubUrlhttps://github.com/neomjs/neo/issues/1757
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtApr 14, 2021, 5:05 PM

controller.Component: change the view parsing from a top down to a bottom up approach

Closed v8.1.0 enhancement
tobiu
tobiu commented on Apr 13, 2021, 4:12 PM

Right now, every component which does get created triggers the parseConfig() logic in case it has its own view controller.

For model.Component I am using a bottom up approach: Every component triggers the parseConfig() logic on the closest view model, not related if it has an own model or not. This means more parseConfig() calls, but each call only parses the top level config and does not touch items.

I want to apply the same strategy to view controllers.

There are several benefits:

  1. We can dynamically add new components including string based listeners and dom listeners, not related to an own vc.
  2. We can immediately resolve references and store them inside the vc.
  3. Parsing events will get easier: before, the top level config already applied the core.Observable mixin, so these listeners got transformed, while this was not the case for items.
  4. We can resolve string based listeners in a smarter way => finding matches inside the controllers parent chain if needed.

In general I think we can simplify the logic and code size by a lot.

I will create sub tickets as needed, already created a new project.

tobiu added the enhancement label on Apr 13, 2021, 4:12 PM
tobiu assigned to @tobiu on Apr 13, 2021, 4:12 PM
tobiu referenced in commit a974bc9 - "controller.Component: change the view parsing from a top down to a bottom up approach #1757 (in progress)" on Apr 13, 2021, 4:16 PM
tobiu referenced in commit c0e5a87 - "#1757 controller.Component: parseConfig() => removing the array check for listeners (no longer needed, since all listeners got parsed by core.Observable now)" on Apr 13, 2021, 4:26 PM
tobiu referenced in commit 95b4cb8 - "#1757 controller.Component: parseConfig() => removing the array check for domListeners (no longer needed)" on Apr 13, 2021, 4:29 PM
tobiu cross-referenced by #1736 on Apr 13, 2021, 4:30 PM
tobiu referenced in commit c494ee5 - "#1757 controller.Component: parseConfig() => finding dom listeners inside the parent chain if needed" on Apr 13, 2021, 4:45 PM
tobiu referenced in commit 4af2601 - "#1757 controller.Component: completely removing the onViewConstructed() logic (no longer needed)" on Apr 13, 2021, 4:49 PM
tobiu
tobiu Apr 14, 2021, 5:05 PM

done!

tobiu closed this issue on Apr 14, 2021, 5:05 PM