Skip to content
This repository has been archived by the owner on Jan 17, 2018. It is now read-only.

Client side processing #35

Closed
Iftahh opened this issue Jan 13, 2013 · 4 comments
Closed

Client side processing #35

Iftahh opened this issue Jan 13, 2013 · 4 comments
Milestone

Comments

@Iftahh
Copy link

Iftahh commented Jan 13, 2013

Looking at the code it seems to me the bulk of the work is done by the the TreeTop - the ruby PEG parser.
There are a few PEG parsers for javascript, so it may be possible to do the entire processing in the client side (javascript) entirely.

This will allow instant feedback (ie. render every keyup event), and also some super cool plugin for IDEs which support javascript plugins.

@Iftahh
Copy link
Author

Iftahh commented Jan 16, 2013

woo! I did it and it works beautifully, zero delay.
I'll clean up the code and make a pull request

edit: see the edited code here https://github.com/Iftahh/regexper/
I have trouble setting up require.js (maybe because I have only static file serving running?) so I loaded the files manually. Other than that the code is as elegant as the original but only in javascript and no ruby.

@jokeyrhyme
Copy link

Could be somewhat related to #37 ??

@javallone javallone modified the milestone: Regexper-2.0 Dec 21, 2014
@javallone
Copy link
Owner

Thank you for this patch (and for introducing me to canopy). After spending far too long deciding if I wanted to do the parsing client-side or do the rendering server-side (to move all the work to one side or another), I ultimately decided to move it all client-side...and to rewrite the whole project in the process.

So, unfortunately I'm not merging this change, but it did point me in the direction I ended up going with the project. The new codebase is in http://github.com/javallone/regexper-static

@Iftahh
Copy link
Author

Iftahh commented Dec 28, 2014

I'm glad you chose the client side - I think it provides much better user experience. Instant feedback makes a tool feel so much better.

You can even show the diagram on the fly as the text is entered - no need for pressing "submit" or even hitting "enter".

Did you check out the other modification I made? Hovering over the diagram highlights the relevant text in the regex - I think it can be useful for the users of this tool (ie. learners of regexps).

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

No branches or pull requests

3 participants