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

browser version of sweet.js #24

Closed
disnet opened this issue Sep 27, 2012 · 9 comments
Closed

browser version of sweet.js #24

disnet opened this issue Sep 27, 2012 · 9 comments

Comments

@disnet
Copy link
Member

disnet commented Sep 27, 2012

Currently we have some node dependencies but would be nice to run in the browser. Need to factor out the require calls and do a little cleaning.

@ryanseddon
Copy link

Just tried running it through browserify but it died on trying to find a parse-js module. This is on windows, will try on osx later.

@disnet
Copy link
Member Author

disnet commented Sep 28, 2012

Same happens on osx, unless escodegen is installed globally I think. Would probably be best if we could avoid using browserify though.

@iammerrick
Copy link
Contributor

If you make this run in the browser, I will make an AMD loader for it... :-) Just let me know when!

  • Merrick

@disnet
Copy link
Member Author

disnet commented Oct 16, 2012

It should work in the browser with AMD now.

@iammerrick
Copy link
Contributor

You beautiful man. Thank you. I can't wait to make this sucker an AMD loader. :-D

@iammerrick
Copy link
Contributor

What do you think of the sweet object having a method to convert the AST back into the compiled JS. This would mean consumers of sweet.js on the client don't have to talk to escodegen directly. It's really more of a sweet.js dependency then a sweet.js consumers dependency...

Example Problem: https://github.com/iammerrick/require-sweet/blob/master/src/sweeten.js#L4

Also, I think the dependencies parser, expander & escodegen ought to be relatively required so as not to require a certain folder structure or set of AMD path entries of sweet.js consumers. underscore is exception here as it is typically a named dependency.

Example Problem: https://github.com/iammerrick/require-sweet/blob/master/example/index.html#L12-14

I would be happy to make a pull request with these updates if you are open to it?

@disnet
Copy link
Member Author

disnet commented Oct 16, 2012

Yeah, that all sounds great.

@iammerrick
Copy link
Contributor

Pull requested.!

@disnet
Copy link
Member Author

disnet commented Oct 22, 2012

Awesome!

@disnet disnet closed this as completed Oct 22, 2012
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

3 participants