8000 WIP: Rewrite by garbles · Pull Request #67 · garbles/yolk · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Apr 25, 2018. It is now read-only.

WIP: Rewrite #67

Merged
merged 90 commits into from
Apr 10, 2016
Merged

WIP: Rewrite #67

merged 90 commits into from
Apr 10, 2016

Conversation

garbles
Copy link
Owner
@garbles garbles commented Jan 4, 2016

Rewriting Yolk because I've learned some shit.

Notable changes will be:

  • Use webpack instead of browserify to bundle
  • Use mocha + chai + karma instead of tape + tape-run to run tests
  • Use rxjs v5
  • Use flow for typed code
  • Use istanbul for code coverage
  • Write a more concise diff algorithm for patching changes (remove virtual-dom in favor of something that directly depends on rxjs)
  • You can no longer infinitely nest observables and have Yolk unwrap them. This was a huge performance hit for large objects and large component trees.
  • Decouple prop/attribute patching to child node patching.
  • createEventHandler as a top-level function? (need to be able to destroy subscriptions)
  • createEventHandler will be just a wrapper for a Subject. allows anyone to use Subjects as eventhandlers. Wrap Subject in a function if injected as a prop to an event handler.
  • createCursor will create an overloaded Subject that will add an additional refine method to scope data. Possibly also create a createContext which wraps a cursor allowing you access it from where ever in the tree, e.g. (push to a later version)
const createContext = cursor => Component => args => {
    return Component({...args, cursor})
  }
}

const _cursor = createCursor(myInitialState)
const WrappedComponent = createContext(_cursor)(Component)
  • Components will be allowed to return observables. This will help with being able to wrap component functions in other functions.
  • move DOM diffing to Web Worker threads (push to a later version. should be pretty easy though)
  • Remove behavior where "un-registered" props wouldn't be appended to node.

@jadbox
Copy link
Contributor
jadbox commented Jan 4, 2016

Excellent list of changes!

Are you sure you want to adopt rxjs v5 when it's not stable yet? I've been told that it's not ready for even simple production use-cases atm. Not sure what the eta is on it becoming stable.

@garbles
Copy link
Owner Author
garbles commented Jan 4, 2016

@jadbox I'm anticipating that this will take me longer to complete than RxJS 😛

@garbles garbles force-pushed the rewrite branch 2 times, most recently from 72fdedd to 30dd2cd Compare January 5, 2016 03:41
@garbles garbles merged commit cbbf634 into master Apr 10, 2016
@garbles garbles deleted the rewrite branch April 10, 2016 20:44
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0