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

dart2js doesn't work anymore with mustache #62

Closed
sircco opened this issue Jun 1, 2017 · 9 comments
Closed

dart2js doesn't work anymore with mustache #62

sircco opened this issue Jun 1, 2017 · 9 comments

Comments

@sircco
Copy link

sircco commented Jun 1, 2017

var salut = compile('Hello {{name}}!');
print(salut({'name': 'Alice'})); //should print Hello Alice!

i recently upgraded from 1.0.10 to 1.1.0 where all worked fine.
Simple example above doesnt work anymore with pub serve in chrome, but works in dartium. I guess its something related to mirrors?

@valotas
Copy link
Owner

valotas commented Jun 3, 2017

How exactly are you using the library? Do you have a public repo that I can have a look?

There are some changes regarding mirrors yes and if you have the problem only on transpiled code, it should have to do with that, but I have to reproduce the problem first.

@sircco
Copy link
Author

sircco commented Jun 3, 2017

we use it in our dev so i thought that something is wrong with our environment so i
created just plain stagehand simple web project, latest mustache as single dep.

main.dart that consists of coypasted lines above
linux 64 bit ubuntu
Dart VM version: 1.23.0 (Fri Apr 21 10:05:24 2017) on "linux_x64"

dart2js, also tried ddc, no luck but works in dartium.

when i reverted back to mustache4dart 1.0.10 it all works fine again

@valotas
Copy link
Owner

valotas commented Jun 3, 2017

Ok, I reproduced the problem. I'll have a look at it asap

@valotas
Copy link
Owner

valotas commented Jun 4, 2017

Can you try to run your app with -DMIRRORS=false ?

@sircco
Copy link
Author

sircco commented Jun 5, 2017

looks like it works that way

@valotas
Copy link
Owner

valotas commented Jun 12, 2017

It looks like dartjs can not handle all cases with reflection. I'm reworking the context computations on #64 and I hope some of the problems will go aways. If you do not have any other problem I'll close this

@sircco
Copy link
Author

sircco commented Jun 12, 2017

we are already running latest git version in production so its safe to say that we have no problems currently

@valotas
Copy link
Owner

valotas commented Jun 12, 2017

what do you mean latest git version? Master is (most of the time) in sync with pub. If you want, you can try branch issue62/dart2js where I did some changes to the mirrors implementation. In any case, if you run with -DMIRRORS=false you do not use that part at all.

@sircco
Copy link
Author

sircco commented Jun 13, 2017

using in pubspec
mustache4dart:
git: https://github.com/valotas/mustache4dart.git
with -DMIRRORS=false
because pub doesn't have strong mode compliancy yet

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