Hacker News new | past | comments | ask | show | jobs | submit login

FWIW, i always use Codemirror as an agument against DSL-specific, locked in components. While declarative React components are "reusable" they're only "reusable [within React]".

Imperative components with APIs is where real reusability exists. Case in point: React can consume them but cannot create them for external consumption.

EDIT: I hate to make this reply self-serving, but this is exactly why domvm [1] now exists. It promotes imperative components with declarative OR imperative view/subview composition. It slots firmly in between Mithril and pure-vdom frameworks, removing structural enforcement and avoiding promotion of a specific MV* paradigm. It's among the most performant vdom implementations to boot.

[1] https://github.com/leeoniya/domvm




I don't know if a lot of people set out thinking, "Oh I'm going to write a component, better do it in React [or Jquery]". They just use the tools they are familiar with to complete their own projects then long after the fact they decide to extract it out and open source it.

At least, that's how I operate.


It depends on how you build your components.

If your component is React all the way down, it will be anything but trivial to extract it and could amount to a full rewrite. In reality this is true for whichever view layer you end up using (domvm included). The difference comes down to the structural flexibility the view layer affords you, speed and the weight it adds to your app code. domvm is 9k min for the view core or 13k min w/mutation observers, isomorphism and router.

In some sense, a jQuery component is much more reusable but slower than any view layer and the most ad-hoc. While there's still a dependency, there is not a jQuery-imposed structural dependency since most of what you're doing with jQuery is manipulating the DOM with some sugar.


When you write an application, it's fine to pull whatever dependency you feel like.

When you write a library, you need to think very carefully about the deps you bring because you'll be imposing it to all your users.


That's right, but most people don't set out to write libraries from day one. They write an application, then extract useful functionality into a library and release that.

The users of the released library inherit whatever dependencies that weren't easily removeable.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: