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

ES5/ES6 wishlist #1302

Open
gfwilliams opened this Issue Jan 9, 2018 · 22 comments

Comments

Projects
None yet
7 participants
@gfwilliams
Member

gfwilliams commented Jan 9, 2018

ES5/ES6 features that aren't in Espruino but that would be useful... I'll do one post per feature, and please use the add reaction button to vote on each one.

@gfwilliams gfwilliams added the question label Jan 9, 2018

@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • String.startsWith/endsWith/includes - would be trivial to add
Member

gfwilliams commented Jan 9, 2018

  • String.startsWith/endsWith/includes - would be trivial to add
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • Proper let implementation - it's just treated as var at the moment, but nobody seems to actually care
Member

gfwilliams commented Jan 9, 2018

  • Proper let implementation - it's just treated as var at the moment, but nobody seems to actually care
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • Proper const implementation - it's just treated as var at the moment
Member

gfwilliams commented Jan 9, 2018

  • Proper const implementation - it's just treated as var at the moment
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • Array.find/findIndex - find by executing a function for comparison
Member

gfwilliams commented Jan 9, 2018

  • Array.find/findIndex - find by executing a function for comparison
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • JS classes - probably not too painful, and seems like it'd tidy up a lot of code
Member

gfwilliams commented Jan 9, 2018

  • JS classes - probably not too painful, and seems like it'd tidy up a lot of code
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • Default argument values
Member

gfwilliams commented Jan 9, 2018

  • Default argument values
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • Array.includes - easy, just indexOf()>=0
Member

gfwilliams commented Jan 9, 2018

  • Array.includes - easy, just indexOf()>=0
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • Object.entries and Object.values
Member

gfwilliams commented Jan 9, 2018

  • Object.entries and Object.values
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • String.padStart/padEnd
Member

gfwilliams commented Jan 9, 2018

  • String.padStart/padEnd
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
  • async/await - although this it likely too difficult to implement in Espruino as it is
Member

gfwilliams commented Jan 9, 2018

  • async/await - although this it likely too difficult to implement in Espruino as it is
@gfwilliams

This comment has been minimized.

Show comment
Hide comment
@gfwilliams

gfwilliams Jan 9, 2018

Member
Member

gfwilliams commented Jan 9, 2018

@FlowerOfLife

This comment has been minimized.

Show comment
Hide comment

FlowerOfLife commented Feb 20, 2018

@gfwilliams

This comment has been minimized.

Show comment
Hide comment
Member

gfwilliams commented Feb 20, 2018

@gfwilliams

This comment has been minimized.

Show comment
Hide comment
Member

gfwilliams commented Feb 20, 2018

@jjok

This comment has been minimized.

Show comment
Hide comment
@jjok

jjok Feb 26, 2018

import and export?

jjok commented Feb 26, 2018

import and export?

@vshymanskyy

This comment has been minimized.

Show comment
Hide comment
@vshymanskyy

vshymanskyy Feb 28, 2018

Contributor

Ok, I was actually able to get async/await working on Espruino (using Babel transpiler and some hacking).
Here is a full example: https://github.com/vshymanskyy/espruino-await
Looks pretty usable, but a native implementation would be so much better ;)
What do you think?

Contributor

vshymanskyy commented Feb 28, 2018

Ok, I was actually able to get async/await working on Espruino (using Babel transpiler and some hacking).
Here is a full example: https://github.com/vshymanskyy/espruino-await
Looks pretty usable, but a native implementation would be so much better ;)
What do you think?

@louisvangeldrop

This comment has been minimized.

Show comment
Hide comment
@louisvangeldrop

louisvangeldrop Mar 24, 2018

Webassembly support?

Webassembly support?

@andrewwakeling

This comment has been minimized.

Show comment
Hide comment
@andrewwakeling

andrewwakeling Apr 3, 2018

Contributor

I did a similar exercise to @vshymanskyy and got various modern JS features working using Webpack/Babel. See: https://github.com/andrewwakeling/espruino-webpack-babel-sample

Although supporting modern JS features (spread, destructuring) out-of-the-box would be convenient, these things are somewhat trivial to support if you compile the code.

I would love to see fixes/improvement to ensure that more modern JS features work correctly and more reliably (after compilation). It would also be great to see improvements that would reduce the size of the compiled code. e.g. Transpiling async/await increases the bundle size a fair amount. I understand that supporting async/await isn't trivial, so I'm not pushing for this.

Contributor

andrewwakeling commented Apr 3, 2018

I did a similar exercise to @vshymanskyy and got various modern JS features working using Webpack/Babel. See: https://github.com/andrewwakeling/espruino-webpack-babel-sample

Although supporting modern JS features (spread, destructuring) out-of-the-box would be convenient, these things are somewhat trivial to support if you compile the code.

I would love to see fixes/improvement to ensure that more modern JS features work correctly and more reliably (after compilation). It would also be great to see improvements that would reduce the size of the compiled code. e.g. Transpiling async/await increases the bundle size a fair amount. I understand that supporting async/await isn't trivial, so I'm not pushing for this.

@opichals

This comment has been minimized.

Show comment
Hide comment
Contributor

opichals commented May 16, 2018

@gfwilliams

This comment has been minimized.

Show comment
Hide comment
Member

gfwilliams commented May 18, 2018

@gfwilliams

This comment has been minimized.

Show comment
Hide comment
Member

gfwilliams commented May 18, 2018

@opichals

This comment has been minimized.

Show comment
Hide comment
@opichals

opichals Jun 6, 2018

Contributor

This would be nice way to deal with stuff like case-insensitive Object key lookup in a standard way.

Contributor

opichals commented Jun 6, 2018

This would be nice way to deal with stuff like case-insensitive Object key lookup in a standard way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment