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

Riot compiler uses trimStart and trimEnd rather than trimLeft and trimRight #2850

Closed
1 of 7 tasks
joshuakb2 opened this issue Apr 15, 2020 · 6 comments
Closed
1 of 7 tasks

Comments

@joshuakb2
Copy link

Help us to manage our issues by answering the following:

  1. Describe your issue:

When interpolating 2 JavaScript expressions into the same string in a riot tag, the String.prototype.trimStart and trimEnd functions get used, but they does not exist in Node until v10.

According to the package.json, the intent is to support Node v8.

trimLeft and trimRight are available prior to Node v10 and have the same behavior as trimStart and trimEnd respectively, so we should use that instead.

  1. Can you reproduce the issue?

I created a Github repository to demonstrate the issue: https://github.com/joshuakb2/riot-trimStart-bug

  1. On which browser/OS does the issue appear?

Ubuntu 19.10, Node 8.17.0

  1. Which version of Riot does it affect?

v4.12.0

  1. How would you tag this issue?
  • Question
  • Bug
  • Discussion
  • Feature request
  • Tip
  • Enhancement
  • Performance
@GianlucaGuarini
Copy link
Member

Duplicate of riot/compiler#129

@GianlucaGuarini
Copy link
Member

GianlucaGuarini commented Apr 15, 2020

I reopened it only to remember to update the node key in the package.json file

@joshuakb2
Copy link
Author

When I change trimStart to trimLeft and trimEnd to trimRight, I don't have any issues with node 8. Is there a reason not to continue supporting the older node version?

@GianlucaGuarini
Copy link
Member

Is there a reason not to continue supporting the older node version?

Yes maintenance costs, performance issues without getting any real benefit. The new Riot.js Compiler supports modern browsers and Node 10 please consider upgrading.

@joshuakb2
Copy link
Author

Cool! Thanks for clarifying.

@GianlucaGuarini
Copy link
Member

This issue was fixed in riot@4.12.1. I'll need to support node8 because the missing features were breaking edge as well (and we need to support edge).

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

No branches or pull requests

2 participants