grasp icon indicating copy to clipboard operation
grasp copied to clipboard

0.6.0 beta - Flow and JSX support

Open gkz opened this issue 7 years ago • 7 comments

Hey guys, Check out and test support for Flow type annotations and JSX by installing the beta with npm install grasp@beta

Still to do:

  • [ ] Update syntax defs with full Flow syntax
  • [ ] Update equery parser to be able to use Flow/JSX

gkz avatar Dec 06 '16 20:12 gkz

Sweet :)

kristianmandrup avatar Dec 08 '16 08:12 kristianmandrup

@ainthek @adros let me know if I'm missing anything that you have in your fork

gkz avatar Dec 14 '16 22:12 gkz

Congrats!

I worked on a major refactoring to split it up into smaller parts that make code more readable and easier to tweak, adjust, unit test etc. I've also added support for a better way to use replace and search as APIs, with support for filter actions to f.ex append/prepend specific nodes, not just Raw.

Was very difficult for me to use existing docs and understand how to use custom replace functions. Please improv docs and tests, esp. covering examples for classes and ES6 stuff, flow, jsx etc.

Cheers!

kristianmandrup avatar Dec 14 '16 22:12 kristianmandrup

I have one more commit, which I haven't include in any PR

https://github.com/gratex/grasp/commit/54d889a654f7b9318d7279ba6

It was just a quick workaround, not widly tested. Take a look at if if you want and I may create PR if you think it's suitable....

adros avatar Dec 15 '16 10:12 adros

Christian: yeah docs are in very "strange" style. See grasp-samples and grasp-tools repo. It took me while do decode gkz thinking.

ainthek avatar Dec 20 '16 17:12 ainthek

Can you expand on how they are "strange", what could be done to improve them?

gkz avatar Dec 20 '16 20:12 gkz

For one add better, more real life examples. I couldn't figure out how to use the replace callback function. Also, no examples for methods in classes etc. Examples are only for very simple cases like adding two numbers and such.

kristianmandrup avatar Dec 21 '16 08:12 kristianmandrup