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

Template literals break IE #77

Closed
bonpixel opened this Issue Dec 2, 2016 · 5 comments

Comments

Projects
None yet
2 participants
@bonpixel

bonpixel commented Dec 2, 2016

Do you want to request a feature or report a bug?
This is a bug

What is the current behavior?
The page does not open in ie11. I get an error: Invalid character

What is the expected behavior?
No error

IE is breaking when it tries to evaluate the template literal here:
https://github.com/riot/route/blob/master/dist/cjs.route.js#L59

Per the MDN it doesn't look like those are supported in IE at all.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals

Steps to reproduce:
Try to use the router in an application loaded into IE11

@bonpixel bonpixel changed the title from Template literals breaks IE to Template literals break IE Dec 2, 2016

@cognitom

This comment has been minimized.

Show comment
Hide comment
@cognitom

cognitom Dec 2, 2016

Member

Hi @bonpixel, try dist/route.js instead.

dist/cjs.route.js is the file for webpack or browserify. You can't use it in browser directly.

Member

cognitom commented Dec 2, 2016

Hi @bonpixel, try dist/route.js instead.

dist/cjs.route.js is the file for webpack or browserify. You can't use it in browser directly.

@cognitom cognitom closed this Dec 2, 2016

@cognitom cognitom added the answered label Dec 2, 2016

@bonpixel

This comment has been minimized.

Show comment
Hide comment
@bonpixel

bonpixel Dec 2, 2016

@cognitom I see what you mean, however, I actually was trying to use riot-route in a browserify context.

When I require('riot-route') in my index file, the cjs.route.js file is what is bundled. This is what I would expect from reading the package.json but I don't understand how are you recommending that I "require" riot-route given I want it in a browserify bundle?

bonpixel commented Dec 2, 2016

@cognitom I see what you mean, however, I actually was trying to use riot-route in a browserify context.

When I require('riot-route') in my index file, the cjs.route.js file is what is bundled. This is what I would expect from reading the package.json but I don't understand how are you recommending that I "require" riot-route given I want it in a browserify bundle?

@cognitom

This comment has been minimized.

Show comment
Hide comment
@cognitom

cognitom Dec 2, 2016

Member

@bonpixel I see. You're right. I didn't care the case without transpilers like babel or buble. Maybe we should transpile it...

Member

cognitom commented Dec 2, 2016

@bonpixel I see. You're right. I didn't care the case without transpilers like babel or buble. Maybe we should transpile it...

@cognitom cognitom reopened this Dec 2, 2016

@cognitom

This comment has been minimized.

Show comment
Hide comment
@cognitom

cognitom Dec 2, 2016

Member

We can simply add buble transpilation here:
https://github.com/riot/route/blob/v3.0.1/rollup.js#L20-L23

Member

cognitom commented Dec 2, 2016

We can simply add buble transpilation here:
https://github.com/riot/route/blob/v3.0.1/rollup.js#L20-L23

@cognitom cognitom closed this in 3e2d7c8 Dec 3, 2016

@cognitom

This comment has been minimized.

Show comment
Hide comment
@cognitom

cognitom Dec 3, 2016

Member

OK, now v3.0.2 has been released and dist/cjs.route.js is correctly transpiled. @bonpixel thanks for pointing it out 😉

Member

cognitom commented Dec 3, 2016

OK, now v3.0.2 has been released and dist/cjs.route.js is correctly transpiled. @bonpixel thanks for pointing it out 😉

@cognitom cognitom added the enhancement label Dec 3, 2016

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