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

Use ES6 syntax to import #7

Open
mukarramali opened this issue Oct 11, 2020 · 8 comments
Open

Use ES6 syntax to import #7

mukarramali opened this issue Oct 11, 2020 · 8 comments
Assignees
Labels
enhancement New feature or request hacktoberfest This is to encourage people contribute in open source help wanted Extra attention is needed Medium People have little experience in the tech stack

Comments

@mukarramali
Copy link
Collaborator

Right now the way we import files and modules in our code follows ES5 syntax.
We have the opportunity to refactor it and move to ES6.
You can look it up here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import

@mukarramali mukarramali added enhancement New feature or request hacktoberfest This is to encourage people contribute in open source help wanted Extra attention is needed Medium People have little experience in the tech stack labels Oct 11, 2020
@opensourceally
Copy link

Can I pick this up?

@Bhavesh27
Copy link
Contributor

@mukarramali Can I Pick this up seems @opensourceally is occupied?

@opensourceally
Copy link

opensourceally commented Oct 18, 2020

I have completed this today. But in the spirit of the assignment take it @Bhavesh27 and complete it. I was trying to do it in TS as well. Got stuck somewhere.

@Bhavesh27
Copy link
Contributor

@mukarramali Added ES6 syntax support. #23 Some major changes. Please do tell if any thing breaking. I tried covering most out of it.

@PPInfy
Copy link

PPInfy commented Oct 18, 2020

@Bhavesh27 - The same can be done by mjs in node.js though it is experimental. Did you try the same? There might not be any need of Babel as it node 13.x here.

@Bhavesh27
Copy link
Contributor

@PPInfy using .mjs extension is experimental + we have to declare project type as module. Babel is smarter choice here it converts the ES7/ES6 syntax to ES5.

@PPInfy
Copy link

PPInfy commented Oct 19, 2020

@Bhavesh27
Copy link
Contributor

https://blog.logrocket.com/you-dont-need-babel-with-node/

Yeah i referenced this only. It clearly depicts we have to enable experimental mode for .mjs file and declare project type as module in package.json. In the last section it mentions use cases where we might need the babel transpiler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest This is to encourage people contribute in open source help wanted Extra attention is needed Medium People have little experience in the tech stack
Projects
None yet
Development

No branches or pull requests

4 participants