-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement missing transformers #1
Comments
@bloodyowl @enlore @hemanth @jbnicolai @jeromew @rlidwka @TimothyGu would any of you like to help out? |
Count me in :) |
Awesome, welcome aboard :) Please make sure you add |
I'm game as well ^^
Good call. |
@ForbesLindesay Here we go! Started with jstransformer-handlebars (Made it look as close as your code.) |
Looks good. Just had a thought though: For templating engines we should support two step compilation (i.e. compile then render). I would suggest we support: exports.compile = function (str, options) {
reutrn function (locals) { /* return resulting string */ };
};
// or
exports.compile = function (str, options) {
reutrn {fn: function (locals) { /* return resulting string */ }, dependencies: [/* array of files */]};
}; We could the have exports.render = function (str, options, locals) {
var compiled = exports.compile(str, options);
if (typeof compiled === 'function') return compiled(locals || options);
else return {body: compiled.fn(locals || options), dependencies: compiled.dependencies};
}; I'll do |
Yup, |
@ForbesLindesay sure I can use some fun porting modules over. |
I'll try to find the time to do some of them |
@ForbesLindesay how about caching? Do we let the libraries handle caching or do we use a DIY one like in transformers? |
Jade transformer written. Function signatures look like this: compile(source, options);
compileClient(source, options);
render(source, options, locals); If this is OK I'll go ahead and write the transformer for EJS too. |
Looking at what's actually in that repo. It looks perfect. i.e. compileFile(source, options);
compileFileClient(source, options); |
For caching: wherever possible we disable all caching. The The only part that I'm not 100% sure on is whether we should do anything for dynamic caches like browserify supports where you avoid re-parsing all the files that haven't changed. Currently my intention is not to do anything special for those unless someone asks for it. |
@ForbesLindesay sounds good. |
Please ✨ |
@JosefJezek TODO added. Uglify-JS and JSON beautifier/uglifier ported. |
verbatim and cdata* are ported. |
@ForbesLindesay I have implemented few of them, but haven't published it yet, as you had mentioned earlier that add all of the owners on GitHub as owners on npm, should I go ahead a publish them or wait? |
@hemanth I already published the ones ported by me. We can change the owners after we publish anyway. |
@hemanth regarding @ForbesLindesay's suggestion of writing a bot that fetches GitHub owners and automatically add them to npm, it's technically not possible as npm login and GitHub login might be different (e.g. ForbesLindesay (GitHub) vs forbeslindesay (npm)). What we can do is add all of the owners to one repo (i.e. this one) and do something like this: owners="`npm owner ls jstransformer | cut -d' ' -f1`"
for p in `curl -s 'https://api.github.com/orgs/jstransformers/repos' | sed -n 's/.*"name".*:.*"\(.*\)",/\1/pg'`; do
for u in $owners; do
npm owner add "$u" "$p"
done
done (Bash FTW) |
@TimothyGu Nice, we must also update the |
@hemanth I would argue against that, as 1. |
@TimothyGu I was thinking that we would maintain a file somewhere that listed all project owner's npm accounts. @hemanth go ahead and publish them, but if possible please add me as an owner on npm via:
|
@ForbesLindesay Done. |
@ForbesLindesay that's fine too, but the question is where. |
✨ I requested a transfer, but don't have access. |
@RobLoach done. I've also invited you to our maintainer team, so you can now push to that repo. |
Thoughts on |
👍 I think for it before few days, but using https://github.com/medikoo/es6-template-strings instead. |
@RobLoach seems to be better to use medikoo's package, its more up-to-date. |
Thanks! Good find.... Updated and moved to here: |
@RobLoach see the commit comment :) |
@stoeffel Used |
@RobLoach yep, but yeoman is too big and too shitty, same as gulp. lol btw, should run |
💯 |
@RobLoach nice 😎 |
hm.. both |
|
list is sorted again
|
I'm not sure about the explosion of postcss based transformers. I feel like maybe we should be taking the approach of the |
Yea, we will, I'll update postcss, rework and styl later today. But they are almost separate transformation tools, commonly used and it will be just sugar of doing This dont have bad side.
And? This isn't jstransformer(s) problem. |
✨ https://github.com/jstransformers/jstransformer-browserify ✨
I think it should take an As a side note, we'll need this plugins pattern for Browserify too. Made an issue: jstransformers/jstransformer-browserify#2 |
@jstransformers/owners First pass on https://github.com/jstransformers/jstransformer-cli .... Let's get discussions going on over in the issue queue there. |
i'll repeat again, there's no bad side of this. it not limit what |
@tunnckoCore The thing is that maintaining those is out of scope for jstransformers. It is crucial to the success of any organisation that it remain focused. There are three reasons this is really important:
|
@ForbesLindesay Choosing to use separate jstransformers in this way, when we have support for both ways would be idiotism, yea. And this would be user's implementation/architecture design mistake, not our problem - we all have heads on our arms to think. I just won't support users that cant think, that dont have some principles and at least little basic knowledge about "what and how", that dont have logical/rational mind. Regards, Charlike. :) |
Its looks better var transformer = cssnext.renderFile('path/to/foo/bar.css', {})
// instead of
var transformer = postcss.renderFile('path/to/foo/bar.css', {plugins: [cssnext()]}) |
postcss and rework now support options.plugins. |
@RobLoach haha, you're good follower! 🐈 |
We still have few left in the potential extras list. |
I've created a Label for this, and added each Transformer as an issue so that we can track them individually: Considering all of our projected initial requirements are met, I'll close this now that we have the other issues open. Great work, guys! |
👍 awesome work. Thanks so much for supporting this project everyone. I'm so excited for how big this is becoming. |
This project aims to replace transformers with a large collection of separate libraries, each of which able to be separately maintained, tested and updated. Each library will implement some subset of the API in this module, and may optionally return a string body rather than the
{body: String, dependencies: Array.<String>}
format (lots of file formats don't actually have dependencies so it wouldn't really make sense). This module can then be used to fully normalise that interface, including implementing the methods that are otherwise not implemented.Here is a list of all the modules that need implementing
jqtplPotential Extras
ccssbugs, need PRs therecoffee-templatestricky shit, atmjscssbugs, need PRs thereOnce all of these have been implemented, we can switch jade to look for these rather than transformers. I'll need as many collaborators as possible for this, so if you're willing to contribute a transformer, let me know and I'll add you to the organisation. P.S. note that we add
jstransformer
to the keywords in package.json for all transformers, so they can be found at https://www.npmjs.com/browse/keyword/jstransformerThe text was updated successfully, but these errors were encountered: