Git Product home page Git Product logo

motion's Introduction

Motion

A simple CLI for running Javascript projects.

Motion repository has been moved inside Pundle's monorepo for better maintenance

Motion can now be found at steelbrain/pundle/motion

๐Ÿ™‡ Thank you everyone who used Motion in their projects. Motion will continue development in it's new home.

motion's People

Contributors

alexkval avatar andrewsb avatar ariafallah avatar natew avatar ncammarata avatar steelbrain avatar stephenlacy avatar vtsatskin avatar xizhao 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

motion's Issues

Faster setPath in dev

Right now using an object to hash method thats super slow, babel could help us, or profile the runtime version and see if theres better.

Nice style errors

$button {
  color: 'blue'
}

should bring up 'did you mean $button = {?' or something similar. This would likely require regex in the compiler, but that is fine because its a syntax err

$button {
  font-size: 16
}

should bring up `flint styles are camelCase. Did you mean fontSize?

I've seen users make both mistakes many times and it's a good opportunity for some really nice errors

Hot reload static assets

This actually probably easier than it sounds:

  • Gulp pipeline for static assets
  • Gulp sends bridge message to reload on asset change
  • Can we just trigger a "reload" in the page somehow? If not, some simple way to force the browser to check for new assets

Keep in mind: assets could be used in all sorts of ways. , , etc. So should stay really generic and simple if possible.

Deep NPM errors

I'm using YQL which requires 'fs'. We should throw an error saying "YQL is trying to access FS" or something similar.

image

Right now we throw this and it's not super helpful.

Force hardware accel in certain cases

This is more exploratory, given Flint is trying to ease a lot of stuff, but without losing full control, this is questionable because it could perhaps cause edge cases. But generally this would be a big win, it's a total pain having to remember to do this.

Updates in update shouldn't run

view Main {
  let exists = true
  <h1>Hello world!</h1>
  <Header if={exists} />
  <button onClick={() => exists = !exists}>toggle</button>
}

view Header {
  let n;
  on('update', () => {
    console.log('in update')
    n = Math.random()
  })

  <header-h2>hi {n}</header-h2>
}

'in update' logs twice when it should log once

Double style error

view Main {
  $h1 = { color: 'red' }
  $h1 = { color: 'red' }
}

Should throw a compile-time error saying "you've defined $h1 twice". We've both run into this many times and it would be a huge usability win

Make comments easier

I had a piece of code

<State if={['/','state'].indexOf(Flint.router.location) > -1} />

and wanted to change it to

<State /> // if={['/','state'].indexOf(Flint.router.location) > -1} />

or something similar, and there were no good ways of doing that. There should be

Remove React-ID

The dom is currently the hardest part about developing with Flint on a real application

image

Extract static styles into separate CSS file

I've added to flint-transform so that it now extracts styles into static and non-static on compile:

Before:

view Main {
  $one = { static: 'style', color: red }
}

After:

view Main {
  view.styles._static.$one = { static: 'style' }
  view.styles.$one = { color: red }
}

But they are all still placed inline on the tag. Now we need to do a second step on mount that:

  • Moves static styles into header CSS
  • Generates className for unique style object
  • Places className on relevant tags in createElement.js
  • Build-time generates .css file and puts it into header

Smarter hot updates

We'd need to hook into babel and:

  • Use babel to do all view transformation
  • Alternatively, we could hack around this by just having babel read something to detect views
  • Once inside views, wrap all getters that are one level inside view:
// before
view Main { let name = 'one' }
// after
view Main { let name = view.get('name', 'one') }

Why? This would enable super smart hot updating, which gives us:

  • Components keep their state on save even when other parts of them change
  • Components update only the state that is changed (keep state of non-changed variables)
  • If you change a variable inside the file, views can keep state
  • Sub-views keep state even when parent changes (just check if props change)

Delete file tries to add script

For some reason gulp runs the deleted file through the pipeline still even after delete, which causes the browser to try and load a script that doesn't exist!

Deep folder errors

I'm structuring my app like

/pages/page1/main.js
/pages/page2/main.js

and when I have an error I don't know which folder it's in

image

It would be more helpful to see page1/main.js as a label

Flint Atom Plugin

Let's start with Atom and move to Sublime quickly, then vim. It should do at base:

  • Drag numbers
  • Live Color Picker
  • Custom syntax highlight (detect views/styles better)
  • Save as you type option
  • Suggestions for CSS attributes (autocomplete eventually)
  • Tag create syntax (type word and hit key to complete tag either self-closing or regular)
  • Collapse/expand all styles
  • Collapse/expand all views
  • Go to view in project

Bring together cli + runner

They are starting to have some real overlap. Upsides:

  • Share modules (spinner, promise helpers, bluebird)
  • Can generate and write configs better

Routing 404

Not even sure if this makes sense, but I need it for an app and there wasn't an obvious way to do it. Would be a use of compile-time routing

Push tests repo

I've been building out a bunch of small tests for various things (not actual tests, just things to run). We should definitely flesh this out and automate it.

Call update before first render

update is where we put logic that should be run before render happens

view Main {
  let exists = true
  <h1>Hello world!</h1>
  <Header if={exists} />
  <button onClick={() => exists = !exists}>toggle</button>
}

view Header {
  let n;
  on('update', () => {
    n = Math.random()
  })

  <header-h2>hi {n}</header-h2>
}

Should show a number different number every time I click toggle. Instead it never sets n

`flint new` hangs on fresh install

Trying out flint on node 4.1.2 with npm 3.3.5 the installer hangs when I run flint new appname3. I tried -ddd and the only output I got was

Looking for updated scaffold in https://github.com/flint-lang/scaffold
Creating app...

Is this a known issue?

NPM: Can't install material-components, fbjs

Starting this because this will require us getting a few things working

  • Working with peerDependencies
  • Install peerDependencies (but not React)
  • Fix fbjs bug wherever that is happenening

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.