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

RFE: add cljs support #189

Open
green-coder opened this issue Jan 11, 2019 · 3 comments
Open

RFE: add cljs support #189

green-coder opened this issue Jan 11, 2019 · 3 comments

Comments

@green-coder
Copy link

This is a open feature request to have Selmer run in cljs so that it could be used in the browser.

@yogthos If someone (maybe me in a hypothetical future) make a PR, would you accept it? Is there anything the contributor would need to know before starting?

@yogthos
Copy link
Owner

yogthos commented Jan 11, 2019

Hi,

I've thought about making Selemer cljc before, and it should be possible to make most of the functionality cross-platform. One thing to watch out for would be that the parser does a lot of character manipulation using the StringBuilder class. I think that goog.string.StringBuffer. should provide sufficient functionality in cljs, but I haven't investigated that much. It would probably make sense to omit template inheritance on the client as well which reduces the scope of work involved.

My main concern in terms of a PR would be around maintainability. Ideally, it would be nice to keep as much of existing code unchanged as possible, and factor out platform specific code, such as instantiation of the StringBuilder into its separate namespaces that would provide platform agnostic API.

@borkdude
Copy link
Contributor

borkdude commented May 7, 2021

Now that all dependencies are optional and Selmer is "pure" Clojure, adding .cljc support would probably be easier. I'm pretty sure everything that Selmer does is possible in CLJS since clojure.tools.reader also works in CLJS and it does similar things with strings, readers and buffers.

@yogthos
Copy link
Owner

yogthos commented May 7, 2021

I was just thinking about this as well, and there's a goog.string.StringBuffer that would be useful here.

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

No branches or pull requests

3 participants