krasimir / absurd

A JavaScript library with superpowers
http://absurdjs.krasimirtsonev.com/
MIT License
1.38k stars 90 forks source link

Would be nice to extract absurd into more self-contained modules #108

Open kristianmandrup opened 9 years ago

kristianmandrup commented 9 years ago

I feel that absurd currently is a little "too big", trying to solve multiple use cases such as html component, templating and css via javascript. Would be nice to split it up into at least these three modules:

absurd-html absurd-css absurd-components

or something along those lines. I'm aware this would likely require quite a bit of refactoring, but I'm sure it would be worth it for ppl who use it... Now I will look into DaddaJS ;)

krasimir commented 9 years ago

Interesting suggestion. Do you talk about the client-side port of the library or for the Node.js module?

kristianmandrup commented 9 years ago

the client-side where it is costly to include parts of libraries I don't need to solve a given use case ;) The server side can deal with a few extra kbs it doesn't need...

krasimir commented 9 years ago

It makes sense. However, as you said it will take some time to completely separate the functionalities like that. I'll leave this issue open and will try finding time for solving it.

kristianmandrup commented 9 years ago

I would recommend to start the separation process internally with one sub-folder for each, then continually testing that it doesn't break... then later break out each sub-folder as a module/package. Cheers :+1:

krasimir commented 9 years ago

I'm thinking about fancy Grunt tasks that include only the necessary files. Then provide fallbacks for the missing functions like just methods with same names and location but empty bodies. Or even better if you try calling some of the cut methods the library will thrown an error saying something like You are using absurd-css version that does not support HTML compilation.

streamich commented 9 years ago

+1 Would love absurd.js much more if it just did CSS pre-processing. Other features should be separate projects.

kristianmandrup commented 9 years ago

+1 for splitting into dedicated projects like absurd-html etc.

krasimir commented 9 years ago

Well, guys I'm thinking about rewriting absurd and indeed maybe creating new modules. Still keep the name "absurd".

tunnckoCore commented 9 years ago

:+1: