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

Advanced JavaScript Topics Workshop #12

Open
maneesht opened this issue Jul 14, 2017 · 6 comments
Open

Advanced JavaScript Topics Workshop #12

maneesht opened this issue Jul 14, 2017 · 6 comments
Assignees

Comments

@maneesht
Copy link
Member

No description provided.

@redixhumayun
Copy link
Contributor

@maneesht Hey, I was wondering if you could take a look at an issue I was having the calculator. So, it seems like when Babel transpiles ES2015 to ES5, it doesn't support CommonJS import and export statements. I uploaded the code with the bug to the calculator branch if you want to take a look at it.

Here is a SO thread for reference to the issue I am talking about. https://stackoverflow.com/questions/29434978/babel-generated-code-causes-error-exports-is-undefined

It seems like the solution would be to use a bundler like webpack, so do you want to do that? I don't think the students would know how to go about configuring webpack by this point would they?

Alternatively, if there is a simpler way to work around this or I've just missed something, let me know and I'll fix it.

@redixhumayun
Copy link
Contributor

Just wanted to add - there might be a simple workaround here (https://babeljs.io/docs/plugins/transform-es2015-modules-commonjs/). I haven't tried it yet, I'll get to it tomorrow.

@maneesht
Copy link
Member Author

I think your options are:

  1. Transform to systemJS
  2. Using a module bundler like webpack
  3. Don't use modules
    I like option 3 since it has the least complexity, but it's up to you to choose and we can discuss from there

@maneesht
Copy link
Member Author

Also, can you adhere to the linting?

@redixhumayun
Copy link
Contributor

Option 3 sounds good to me. It might make the code messy, but that's just something to deal with.

And by linting, do you mean just running the code through ESLint?

@maneesht
Copy link
Member Author

maneesht commented Jul 26, 2017 via email

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