Code Monkey home page Code Monkey logo

birdseye's People

Contributors

aggre avatar dependabot-preview[bot] avatar ktsn avatar robinsondotnet 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

birdseye's Issues

Capture and log previewed component's errors

For implementing #2, I noticed there are many cases previewed components throws errors during editing props/data. For example, props validation, unexpected null value and so on.

It would be useful capture and log such errors so that it prevents clashing the birdseye app by trivial errors. Also the log would be useful for the users for debugging components.

Allow to edit meta data on the app

  1. Show pattern data (props, data, etc...) on the app
  2. Allow users to edit their values.
  3. The changes are pull back to the actual file (such as <birdseye> custom block on Vue SFC) by pressing something like "Save" button.

It would be useful also supporting the following features:

  • Add a new pattern on the app.
  • Remove an existing pattern on the app.

Log emitted events

It should be useful to log emitted events from components since we can confirm the output from them.

The log would include event name and passed arguments.

Allow to inject extended Vue constructor and root component options

It is common in Vue ecosystem to extend Vue constructor or inject some object from root instance.

Example for vue-router:

import Vue from 'vue'
import Router from 'vue-router'

// extend Vue constructor with vue-router
Vue.use(Router)

const router = new Router({ /* ... */ })

// inject vue-router instance to pass it into root component options.
new Vue({
  router,
  // ...
})

So we should provide some functionality to achieve this pattern on @birdseye/vue.

We simply could provide both of them some function and let return instrument function from that.

import Vue from 'vue'
import Router from 'vue-router'
import birdseye from '@birdseye/app'
import { createInstrument } from '@birdseye/vue'

// prepare router
Vue.use(Router)
const router = new Router({ /* ... */ })

// create instrument function with Vue constructor and router instance
const instrument = createInstrument(Vue, {
  router
})

// Load all your component
const load = ctx => ctx.keys().map(ctx)
const components = load(require.context('./src/components', true, /\.vue$/))

// Mount component catalog
birdseye('#app', instrument(components))

Slot (children) support

We could allow users to write slot content as meta data.

<birdseye>
{
  "name": "Component",
  "patterns": [
    {
      "name": "Slot pattern",
      "props": {},
      "slot": {
        "default": "<p>This is slotted content</p>"
      }
    }
  ]
}
</birdseye>

devtools support

The current implementation is that the root instance of previewed component is lazily created/mounted. vue-devtools cannot detect such lazy-mounted component because it walks DOM tree just after the page is loaded.

We should change the implementation to mount preview's root instance immediately and dynamically inject each component with retaining the root instance to support vue-devtools.

Collect props and data info from components

It would be useful if we collect props and data info from components. For example:

  • Provide appropriate form type for props type. (#2 )
  • Automatically passing default value of props type to component if the value is not specified.

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.