GithubHelp home page GithubHelp logo

metal / metal.js Goto Github PK

View Code? Open in Web Editor NEW
230.0 230.0 63.0 8.46 MB

Build UI components in a solid, flexible way

Home Page: http://metaljs.com

License: Other

JavaScript 97.01% CSS 0.01% HTML 0.02% SCSS 0.48% Closure Templates 2.49%
javascript javascript-framework metal

metal.js's Introduction

Metal.js

Build Status Join #metal on our Slack Channel

Build Status

Metal.js is a JavaScript library for building UI components in a solid, flexible way.

Support and Project status

Metal.js is widely used and well maintained internally at Liferay but does not currently have staffing to support the open source release. As such this project is mostly internal and support is minimal. For certain issues, like build integration we are in an especially bad position to offer support.

To get assistance you can use any of the following forums

  1. Look through the documentation.
  2. File an issue on GitHub

We will try our best, but keep in mind that given our support staffing, we may not be able to help.

Setup

  1. Install NodeJS >= v0.12.0, if you don't have it yet.

  2. Install lerna global dependency:

[sudo] npm install -g [email protected]
  1. Run the bootstrap script to install local dependencies and link packages together:
npm run lerna
  1. Run tests:
npm test

Developer Tools for Metal.js

Big Thanks

Cross-browser Testing Platform and Open Source <3 Provided by Sauce Labs

License

BSD License © Liferay, Inc.

metal.js's People

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

metal.js's Issues

Functional components in metal.js

React has functional components which don't have lifecycle methods. It is not a critical feature but it does help make the code more readable and react is planning to do interesting things in the future with this feature. It might make sense for metal to also have an equivalent.

Soy Component render mutates dom nodes

It looks like soy components mutate dom nodes on first render. This might cause weird side-effects like lost event listeners. Take the following code:

var button = $('#buttonId');

button.on('click', function(event) { ... });

new Dropdown({
    element: '#buttonId'
}).render();

console.log(button[0] === $('#buttonId')[0]); // false -> click listener is lost

An obvious workaround is of course to make sure the code adding the listeners runs after the soy rendering, but this is not always possible, and looks like a serious limitation to integrate metal-based components...

Is .ATTRS really necessary?

I know we're based in YUI's attribute model but I wonder if having this static variable really adds any value.

Make components render by default

I'm proposing we do away with requiring the render call manually, unless someone passes render: false as part of the config.

With YUI, in 90% of the cases, when we instantiated the component was also when we wanted to render it.
So my proposal would end up looking like:

let myCmp1 = new MyComponent({}); //renders component

let myCmp2 = new MyComponent({ render: false });
// do some work ...
myCmp.render();

What do you guys think?

Updating a template from within itself can break things

I've pasted an example of the Soy file and the js here: https://gist.github.com/natecavanaugh/c9d98fceb794757abe73

The gist of it is though that inside of the body template, on input I call updateBD, which will update the bodyContent property of the template with the value (but I believe this could be any variable passed to the template).
If you build that component, you can see that it is completely unusable.
Where I can see something like this being important is in something like the CharCount module, where we need to say how many characters we have left.

Let me know if there are any questions about reproducing it.

Metal Lifecycle Method equivalent of componentWillReceiveProps()

We have a case where we want to be listening for a change when a config has been updated to a new value.

In React, the way this was done was through listening for any changes to props and then identifying if the prop being changed is different to the old.

componentWillReceiveProps(nextProps) {
    if (JSON.stringify(this.props.foo) !== JSON.stringify(nextProps.foo)) {
        this.changeAction();
    }
}

I am not convinced that this is the best way of doing this so any alternatives to including a lifecycle method would also be fine.

Thank you!
Angelo Youn

Create logo

Pretty soon we'll need a website to display our documentation, attract users and potential contributors. In order to do so, we should start with a visual identity and logo.

@vitorfernandes could you help us with that?

Describe why is this better than an existing solution

On About, we should be able to briefly describe why this framework is better than something out there. For example, why do we have a better API than Angular? Why is our solution faster than React's Virtual DOM? Basically why should people care about this?

Support for accessors properties in mergeSuperClassesProperty

let counter = 0;

class Test1 {
  static get FOO() { return counter++; }
}
class Test2 extends Test1 {
  static get FOO() { return counter++; }
}

core.mergeSuperClassesProperty(Test2, 'FOO');

assert.deepEqual(Test2.FOO_MERGED, [ 0, 1 ]);
assert.deepEqual(Test2.FOO_MERGED, [ 2, 3 ]);
assert.deepEqual(Test2.FOO_MERGED, [ 4, 5 ]);

</uselessly-pedantic>

Solidify proper project name

Is it Metal, MetalJS, Metal JS, Metal.js?

"Metal", on it's own, will not Google well.

I assume it's Metal.js. We should refer to it consistently as Metal.js, not Metal.

Also, since this is early in it's life, should the project url (liferay/metal) in Github be updated to liferay/metal.js or liferay/metaljs?

Adds temporaty promise polyfill

We need a promise, therefore it require time to implement a good one. For now we borrowed from Closure Library and eventually we will replace with our own implementation.

Use higher-level classes

export default function MetaDisposable(parent) {
  return class Disposable extends parent {
    // …
  }
}

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.