Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More slightly anal code generation stuff #442

Closed
Rich-Harris opened this issue Apr 3, 2017 · 0 comments
Closed

More slightly anal code generation stuff #442

Rich-Harris opened this issue Apr 3, 2017 · 0 comments

Comments

@Rich-Harris
Copy link
Member

Rich-Harris commented Apr 3, 2017

REPL. When we have components without bindings, it doesn't really make sense to have an intermediate variable for the component's initial data:

// this...
var smileyFace = new SmileyFace({
  target: svg,
  _root: component._root || component,
  data: { x: 50, y: 200, size: 100 }
});

// ...not this:
var smileyFace_initialData = {
  x: 50,
  y: 200,
  size: 100
};
var smileyFace = new SmileyFace({
  target: svg,
  _root: component._root || component,
  data: smileyFace_initialData
});

On the SmileyFace component, the comment over namespace is preserved:

var template = (function () {
  return {
    // you can either use the shorthand 'svg', or the full
    // namespace: 'http://www.w3.org/2000/svg'. (I know
    // which one I prefer.)
    data () {
      return {
        x: 100,
        y: 100,
        size: 100
      };
    }
  };
}());

It would be cool if comments immediately preceding a removed property were removed along with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant