npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

elmish

v0.0.1

Published

This is a toy project implementing the [Elm architecture][arch] with React and Coffeescript.

Downloads

3

Readme

Elmish

This is a toy project implementing the Elm architecture with React and Coffeescript.

To get it running:

git clone https://github.com/ccorcos/elmish.git
cd elmish
npm install
node server.js
open http://localhost:3000/

Check out entry.coffee to select the example you want to run and work your way through the tutorial.

The Elm archirecture is a very power functional programming pattern for building user interfaces with all kinds of perks. Views are pure funtions of the state of the program. This means you can render any view in any state. So you could create an app of every view in every state making it trivial to re-style your app. You can also record the actions and the state making it easy to implement undo/redo, invalidate latency compensation action, and debug production errors.

To Do

  • move on to giphy example

  • debug example

  • github example

  • socket.io chatroom example

  • meteor example with the new

  • list of component example

  • laziness (?) and immutability

  • immutable.js and functionize

  • undoable component example

  • giphy + http example

  • debug example

  • github example

  • chatroom example

  • polish the http service

  • concepts of composable queries and fragments as functions

  • http caching

  • oauth service

  • passport.io service?

  • chatroom with graphql

  • GraphQL

    • create schema without "this" or "new"
      • https://github.com/devknoll/graphql-schema
      • https://github.com/matthewmueller/graph.ql
    • use JSON query instead of stings
      • https://github.com/ooflorent/babel-plugin-graphql
    • client cache?
      • read cache sync and rest async?
    • mutations
      • latency compensation
      • reactivity
    • backend? database? websockets?
  • github explorer project

    • isomorphic
    • graphql
    • oauth
    • stateless and pure UI
      • navvc
      • tabvc
      • splitvc
      • search
      • hotkeys
      • routing
      • animation
    • time-travel
    • generate tests
    • save sequences
  • chatroom project

    • custom auth or passport.io
    • socket.io or elixir
    • mongo or redis
  • listOf

    • how to handle multiple dispatch handlers?
  • chatroom example

    • graphql? falcor? express? meteor?
  • tutorial examples to js

  • time-travel import/export/save sequences

  • performance, lazy, memoize

  • meteor http side-effect

  • meteor subscribe side-effect

  • socket.io subscribe side-effect

  • phoenix subscribe side-effect

  • json-diff-patch stateless chatroom example

  • elixir composable queries?

  • responsive split-view component

  • animation state

  • user auth

  • routing

Thinking...

UI components look like this:

init : () -> state view : (dispatch, state, data) -> html request : (state) -> query update : (state, action) -> state

They compose up in the same way you're used to. Effects are just some sort of declarative way of building queries.

Then there are components to handle the data/side-effects. HTTP is an example. It caches data within its state and declaratively passes on effects its still waiting on. This time, effects gets a dispatch method so we can map over it and listen for the results. We need to think of effects just like render. We're declaratively saying what we want and binding event listeners to dispatch the results.

init : () -> state update : (state, action) -> state effects : (dispatch, state) -> {html, fetch, meteor}

  • We need to think about better names. For UI stuff, we can think about request, query, and data all together, very much in the UI realm. In a more general sense, once we've dealt with composing the requests, we can think of rendering html, fetching, subscribing, all as side-effects and different services that declaratively parse the data structure and asynchronously trigger event listeners.

  • the debug component can simply filter the effects and actions for pause/play and remember the states.

maybe we ought to do this one first, maybe just with gihpy init : () -> state update : (state, action) -> state effects : (dispatch, state) -> {html, fetch, meteor}

Notes

React has a basic JSON declarative tree:

{ type: 'div', props: { className: 'user-item' onClick: (e) => this.setState({selected: user.id}) } children: [{ type: 'span' props: {} children: [user.id] }] }

When we build our user interface, we're just patching these trees together.

GraphQL has a basic declarative JSON tree as well:

{ fields: { followers: { params: { userId: user.id }, fields: { name: {}, posts: { params: { limit: 20 }, fields: { count: {}, edges: { ?? https://github.com/ooflorent/babel-plugin-graphql } } } } } } }

GraphQL gets patched together by.... Relay, fragments...?

We can create similar structures for other services as well.

  • Hotkeys
  • HTTP
  • Meteor