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

SyntaxError: Unexpected token . #3

Open
YodaLightsabr opened this issue Mar 26, 2021 · 9 comments
Open

SyntaxError: Unexpected token . #3

YodaLightsabr opened this issue Mar 26, 2021 · 9 comments

Comments

@YodaLightsabr
Copy link

image
What's that all about?

@Skillz4Killz
Copy link
Owner

@YodaLightsabr Hey, thats is a new JS feature. Your Node.JS may be outdated so it does not support that. You will have to update node.js

@YodaLightsabr
Copy link
Author

How new is it?

@Skillz4Killz
Copy link
Owner

@YodaLightsabr
Copy link
Author

This makes absolutely no sense. And if you only use it here, it would make sense to use a slightly longer syntax to support a node version that isnt even that old.

@YodaLightsabr
Copy link
Author

const language = this.languages.get(teamId) || (team || {}).locale || 'en_US';

@YodaLightsabr
Copy link
Author

if team is undefined, replace it with a blank object, and if locale isn't available, it's most likely the blank object. (If I'm even understanding what the optional chaining thing does correctly.)

@Skillz4Killz
Copy link
Owner

Skillz4Killz commented Mar 27, 2021

@YodaLightsabr A better solution to support older node is to change the target version of tsconfig. Remember, TS can compile this latest code into older code which i am more open to. I don't want to intentionally make the libs code worse just so it can support super old versions of node.

gapi will always use the latest and greatest code in it's own code. The generated JavaScript I am open to modifying. Please can you recommend me which would work for your needs and you can even send a PR to change the target

https://github.com/Skillz4Killz/gapi/blob/master/tsconfig.json#L7

Please note that any older version could come with slower performance, potential bugs and more. It's always best to use latest code imo.

@YodaLightsabr
Copy link
Author

@YodaLightsabr A better solution to support older node is to change the target version of tsconfig. Remember, TS can compile this latest code into older code which i am more open to. I don't want to intentionally make the libs code worse just so it can support super old versions of node.

gapi will always use the latest and greatest code in it's own code. The generated JavaScript I am open to modifying. Please can you recommend me which would work for your needs and you can even send a PR to change the target

https://github.com/Skillz4Killz/gapi/blob/master/tsconfig.json#L7

Please note that any older version could come with slower performance, potential bugs and more. It's always best to use latest code imo.

Yes, it is, but supporting version 12.16.1, which was only about a year ago, does not seem unreasonable. People will be unable to use this package on Replit.com, which is always a little behind on updating Node.js, if you're always using the latest features to save 10 characters of code writing.

@Skillz4Killz
Copy link
Owner

@YodaLightsabr I am open to allowing this to support older node version. I want to change the JS target for the TS compiler. It will compile to any older nodejs version you need. Currently, i use es2020 because that is the latest but if you need something older please tell me which you need so we roll it back to that version. I don't use replit so you will have to look into which target version is right for this and i can change it for you with that information. The different supported versions are listed in that link i shared in the last comment.

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

2 participants