Coder Social home page Coder Social logo

attributes-kit's People

Contributors

almad avatar danielgtaylor avatar freaz avatar honzajavorek avatar jackub avatar kylef avatar miiila avatar nadade avatar opichals avatar patricksmms avatar tjerabek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

attributes-kit's Issues

NPM Tasks

I just wanted to discuss built-in NPM tasks as it seems there's no convention and no structure around them.


Below is a list of the current NPM tasks.

  • build
  • playground
  • lint
  • start
  • unit-tests
  • visual-testing
  • prepublish
  • generate-fixtures

My proposal would be the following.

  • npm start

    Spins up the development server.

    • By going to localhost:8080 (or localhost:8080/playground) you can try the Playground.
    • At /seed there's a demonstration of usage of the Seed.
    • When you hit /examples you can see a long list of examples, displayed in 3 columns—first column displays MSON, second Refract elements, the last one shows the rendered Attribtues Kit.

    Questions

    • /playground and /seed require a different Webpack build.
    • Both routes should reflect recent changes (= rebuild on change).
  • test

    Run all test.

  • test:unit

    Run all unit tests, optionally you can run them in the watch mode via npm run test:unit --watch.

  • test:functional

  • test:examples

  • test:coverage

  • lint

  • build

    Build all.

  • build:server

  • build:browser

Array rendering: samples and values

This value
- address: *street*, city, *state* (array, fixed)

Gets rendered as three array values

image

"value": {
          "element": "array",
          "content": [
            {
              "element": "string",
              "attributes": {
                "samples": [
                  "street"
                ]
              }
            },
            {
              "element": "string",
              "content": "city"
            },
            {
              "element": "string",
              "attributes": {
                "samples": [
                  "state"
                ]
              }
            }
          ]
        }

They are three different element.

Seed API

Seed API

import {AttributesKit} from 'attributes-kit';
Render Shortcut
AttributesKit.render(refractElement, HTMLElement|String)
Using an Instance
let myAttributesKit = new AttributesKit({
  element: HTMLElement|String
});

myAttributesKit.render(refractElement)

The advantage of the instance is that you can subscribe to it.

myAttributesKit.on('click', Function);

Reference

Principle of least privilege for components

We're passing quite often more data than needed for rendering components.

Example

        <div className="attributeObjectMemeberKey">
          <KeyComponent data={this.props.data} />
        </div>

        <div className="attributeObjectMemeberRequirement">
          <RequirementComponent data={this.props.data} />
        </div>

Both of them do not need the entire data object.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.