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

Customizable merger per view type #7

Open
kmrozek-siili opened this issue Sep 17, 2016 · 0 comments
Open

Customizable merger per view type #7

kmrozek-siili opened this issue Sep 17, 2016 · 0 comments
Assignees

Comments

@kmrozek-siili
Copy link
Contributor

kmrozek-siili commented Sep 17, 2016

Currently merging strategy is coupled with VDOM merger and cannot be customized. You cannot create specific strategy for your own view type. This is important for couple of reasons:

  1. It could fix in elegant way, problem with text input position. We could create specific view type for input that supports storing text position before updating text and restore it after that. It
  2. It would allow to create custom views to implement integrations with foreign libraries (like Codemirror or Leaflet).

Possible solution is add specific "class" - ViewMerger that would implement methods like

  • merge - move functions like mergeTag, mergeText from VDOM createMerger
  • createNode - remove node() method from View and decouple it from View
  • finishAttach - called after node creation
  • prepareDestroying - called before node destroy

Additional class ElementViewMerger would contain specific methods like

  • setProperty - here we would fix input field issue

ViewMergers would be declared in createMerger call. Couple of ViewMergers would be declared by default. It would be ElementViewMerger, TextViewMerger and InputViewMerger.

@mrroman mrroman changed the title Customize merger per view type Customizable merger per view type Sep 18, 2016
@mrroman mrroman self-assigned this Sep 18, 2016
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

2 participants