-
Notifications
You must be signed in to change notification settings - Fork 709
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
[WIP] Add support for CSS parsing and future categories. #62
Conversation
|
||
p { | ||
background-color: yellow; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it's WIP so probably just wanted to get something working.
Might be good to leave the same kind of comments from the js example and maybe show off some more css ast nodes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, totally open to modifications, just needed something to play with.
lol wow - screenshots 😄? |
As I said, need helo with testing, so it will be extra motivation to run locally for now :P (if seriously, not near the laptop anymore today) |
Awesome, thank you so much! I'm pretty busy during the week but hopefully have some time over the weekend to take a closer look! |
One known issue that is left so far is not changing code when e.g. turning on transformer while CSS was activated. Unfortunately, app.js feels somewhat complicated due to various events that change state in different ways and I struggle to properly change all the relevant places :( Maybe we should use smth like Redux for simplifying state management? (although I understand that switch might be not too easy, it's just that makes me sad how hard it's to add modifications to UI component of AST explorer compared to how easy is to add parsers) |
Yeah, it used to be a lot simpler :P Switching to redux was also on my mind, but I simply haven't had the time yet to do anything in that direction. |
Do we need a category button? Couldn't we just keep a single parser button and list the different parsers in separate columns? The parser itself should already know to which category it belongs to. Or would that make things more difficult in the long run? |
Initially I had nested menu, but yeah, it feels a bit harder to manage, especially for auto-choosing parser category from dropped file, adding new categories etc. But if you want to refactor it in the way those things will be still simple, I'm all for it. |
@fkling So, as for change of parser category on transformer - I'm leaving it for now, if you could help, it would be highly appreciated. Also, I have implemented one more new category 😉 , but I'll better leave it until this is cleaned up and merged as this PR already got way too much changes :) |
Uh nice :) I can't say how much I appreciate your contributions thank you! I'll work on this tomorrow. |
0e67cfe
to
081a801
Compare
Well it's fun to work on this kind of stuff for me too :)
I'll likely be busy (or rather having some rest) tomorrow, but feel free to write any questions, I'll respond as soon as get free. |
8372a43
to
8bcf2b7
Compare
7e7161b
to
0e1e865
Compare
@fkling Added some structure and UI amendments and CSSOM parser. Please stop me until I push everything to one PR :) |
* Add getNodeName support to array-like objects which are not arrays. * Hide `length` from any array-like objects. * Show extra properties on array-like objects (similar to Node.js console.log). This improves uglify-js, CSSOM and other outputs.
0e1e865
to
c6508cc
Compare
1c3ffa4
to
78a55cd
Compare
Fixed this one in a different way - transformer list is now also limited only to chosen category in the same way as parsers, which both solves this issue and helps for adding future CSS transformers and so. |
Makes sense to me. I guess having a dedicated button for the category isn't such a bad idea after all.
I'm trying to merge everything today, so please STOP :P ;) |
Soooorry, one more fix :) |
Aaand... Done for now. There is one more specific scenario, which is not properly handled, but should be fine for now. |
Just to explain stuff related to
So that when adding new category, parser or transformer you don't need to modify a lot of IMO, this should simplify adding new modes a lot and encourage people to contribute. |
That's pretty sweet :) I started merging the changes locally. I made two additions:
I think I just have to merge the HTML stuff tomorrow and this should be good to go! :) |
Sounds great to me! |
Does it mean it stores last category, too? Or how does it restore it when refreshing the page? |
Yes, that too! |
[WIP] Add support for CSS parsing and future categories.
Depends on #61 to be merged first, and might be a bit buggy yet, as I did only basic testing and help with it would be appreciated.
Also, TODO: add CSS transformers, but that's probably worth separate PR.