Skip to content

Some ideas for API enhancement #55

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

Closed
brody4hire opened this issue Nov 30, 2016 · 2 comments
Closed

Some ideas for API enhancement #55

brody4hire opened this issue Nov 30, 2016 · 2 comments
Labels
awaiting submitter needs a reproduction, or clarification

Comments

@brody4hire
Copy link

  • Use something like the Factory_method_pattern to enable people to write JavaScript without the need for new keyword.
  • Something similar to tmpvar / weld to enable people to write HTML without the need for special template syntax
  • API similar to marko-js / marko

In general I really like the idea of this project and would like to thank @nolanlawson for tweeting it.

@emirotin
Copy link

emirotin commented Dec 2, 2016

+1 for factory, would be nice to make new optional and also easy to achieve

@Rich-Harris
Copy link
Member

It's easy enough to make new optional but is there a good reason to do so? By adding the instanceof check at the start of every component, you've added extra bytes to everyone's application for the sake of allowing developers to write code that's actually less idiomatic. (With ES2015 classes, you have to use new, so over time new-less instantiation is going to seem ever more weird and out of place). Not to mention that it's a redundant check for nested components.

If it's purely to prevent errors, then maybe a development warning would be a better approach.

@brodybits do you have specific API suggestions? 'Make it like these other projects' isn't something we can work with, unless it's clear what you mean and why it would be an improvement 😀

@Rich-Harris Rich-Harris added the awaiting submitter needs a reproduction, or clarification label Dec 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting submitter needs a reproduction, or clarification
Projects
None yet
Development

No branches or pull requests

3 participants