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

Refactor into 4 npm packages #38

Closed
wants to merge 4 commits into from

Conversation

Raynos
Copy link
Collaborator

@Raynos Raynos commented Apr 1, 2014

  • vtree contains the data structures & diff
  • vdom contains patch & create-element that depends on vtree
  • vh is an independent sugar module that depends on vtree
  • vthunk is an independent widget module that depends on vtree & vdom

I also made a util-wtf folder. Please replace that with

  • isarray
  • is-object
  • replace is-string with typeof s === 'string' which is cross browser.

Also note @Raynos is an asshole and took the name vdom-thunk on npm already.

@Raynos
Copy link
Collaborator Author

Raynos commented Apr 1, 2014

cc @neonstalwart

So myself & @Matt-Esch were talking about this refactoring.

The purpose for this refactoring is to make h optional sugar & to make vtree usable on it's own.

You can imagine that someone might write vansi or vcanvas that implements create.js and patch.js for ANSI terminal or <canvas>

@Raynos
Copy link
Collaborator Author

Raynos commented Apr 1, 2014

@Matt-Esch having audited the vtree/diff.js code the only thing that is bad is the hardcoded 'style' key.

I will generalize our 'style' handling for all objects in a seperate PR.

@neonstalwart
Copy link
Collaborator

i don't know that separate packages is completely necessary to achieve your goal but the separation you're suggesting seems a logical way to decompose virtual-dom so i have no objection to it.

btw, is-object isn't used anywhere.

@neonstalwart
Copy link
Collaborator

actually... this separation should also encourage more reuse/collaboration for things that are a different flavor of sugar (like in #22) 👍

@Raynos
Copy link
Collaborator Author

Raynos commented Apr 3, 2014

I need to update this pr to add a diff.js that is module.exports = require("./vtree/diff.js") and the same for other files so we can merge this and keep working on all 4 modules inside virtual-dom until we are ready to break them out.

That way this is a first pass at a seperation that makes sense and we can polish the seperation until we are truly happy with it.

@Matt-Esch
Copy link
Owner

The reorganization has been pushed in commit 91ad33f - expect the subdirectories to end up as standalone modules in the near future

@Matt-Esch Matt-Esch closed this Apr 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants