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

What's coming next & Superfine v. Hyperapp #134

Closed
jorgebucaran opened this issue Jul 4, 2018 · 10 comments
Closed

What's coming next & Superfine v. Hyperapp #134

jorgebucaran opened this issue Jul 4, 2018 · 10 comments
Milestone

Comments

@jorgebucaran
Copy link
Owner

jorgebucaran commented Jul 4, 2018

Here is a mixed list of current and upcoming Superfine features and changes. Some of these may not be available to Hyperapp or vice-versa. I'm planning to work through these after Hyperapp V2 is out.

  • Typescript rewrite.
    • Use more ES6 features, e.g., Map, arrow functions, destructuring.
  • Superfine will continue to support lifecycle events as a pragmatic solution for enter/exit animations, encapsulation of state, global event listeners, etc. See Lifecycle Events. Should they stay or should they go? hyperapp#717 for more uses and why they're going to be removed from Hyperapp.
  • Lazy views. See: V2 Lazy lists/components hyperapp#721
    • Lazy views allows you to declare a part of your VDOM should be re-rendered only when some data changes. This features is equivalent to Elm's Html.lazy.
  • Expose eventProxy.
    • Intercepting DOM events allows Hyperapp to couple VDOM and state management. Another use could be auto-redrawing. What else could you use it for?
  • JSX fragments (vnodes of type array) Add support for JSX fragments #71.
  • Explore class components (not available to Hyperapp)
  • Shadow DOM?

@jorgebucaran jorgebucaran added discussion enhancement New feature or request labels Jul 4, 2018
@jorgebucaran jorgebucaran modified the milestones: 6.0.0, 7.0.0 Jul 4, 2018
@rbiggs
Copy link

rbiggs commented Jul 5, 2018

Was wondering if you're familiar with Raj: https://github.com/andrejewski/raj. Kinda similar goals to Hyperapp -- Elm Architecture for JavaScript.

@jorgebucaran
Copy link
Owner Author

Yep.

@brandonros
Copy link

As it stands, what does Superfine provide that Hyperapp 1.0 does not and vice versa?

@rbiggs
Copy link

rbiggs commented Jul 6, 2018

@brandonros Superfine is just a Virtual DOM. You could use it with functional components and JSX for a bare bones fill-in for P/React. It's only 1KB.

Hyperapp has a Virtual DOM but also provides state management inspired by the Elm Architecture. If you're using Superfine and need state management, you'll need to include Redux, Mobx or write your own solution. If you use Hyperapp, you get everything you need.

@rbiggs
Copy link

rbiggs commented Jul 6, 2018

@jorgebucaran, you mention a possible TypeScript rewrite for Superfine. What if you just stick with JavaScript and use JSDoc comments to define the types? If you're using VSCode or Webstore, you'll get type checking and intellisense right away. For VSCode you just add the following to you user settings:

"javascript.implicitProjectConfig.checkJs": true

This tells VSCode to use TypeScript to parse your JavaScript to understand the types. Now if you include JSDoc comments, then TypeScript will use those for understanding the types. You can define custom types, import types from other files, define union types, intersection types, even do type casting. All while writing JavaScript. They're just standard JavaScript comments, so they go bye-bye during minification. No need for a build like with TypeScript.

Microsoft uses JSDoc comments in their .d.ts files to provide richer intellisense for TypeScript.

Actually I already did a branch of Superfine with full JSDoc support, but I haven't pushed it to Github. I you want I could so you can check it out and see the difference it makes.

@yisar
Copy link

yisar commented Mar 22, 2019

So whose performance and diff is better now for superfine and hyperapp@2.0.0.alpha.10?

Does superfine pursue performance and hyperapp control size in the future?

@jorgebucaran
Copy link
Owner Author

@132yse Superfine and Hyperapp 2 share the same VDOM implementation (or close), so they should be about the same performance-wise. Hyperapp lacks lifecycle events and regular DOM events are bound to dispatch actions without an intermediate event handler, so it should perform better overall.

@yisar
Copy link

yisar commented Mar 22, 2019

@jorgebucaran But I found that superfine and hyperapp have different vdom algorithms at this time, hyperapp reduces a lot of bytes.

Is performance getting better and better? Or did hyperapp lose some of its performance for size?

@jorgebucaran
Copy link
Owner Author

@132yse You're probably looking at Hyperapp 1's VDOM, hence the confusion.

Superfine (this project) and Hyperapp 2's VDOM code is essentially the same, therefore performance is the same too.

Hyperapp 2 doesn't include lifecycle events (Superfine still does) and DOM events dispatch actions directly, making it faster than Superfine, but possibly not for a lot.

Or did Hyperapp lose some of its performance for size?

No, it didn't.

@jorgebucaran
Copy link
Owner Author

Superfine 7 is out. I think we're done here. Some of the stuff I wrote up there is either outdated or never materialized. Check out the docs to know what's in it or not. 👋

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

4 participants