Closed ForbesLindesay closed 9 years ago
@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 forbeslindesay
as an owner if you publish any new jstransformers to npm. I'll write a bot at some point to add all of the owners on GitHub as owners on npm :)
I'm game as well ^^
I'll write a bot at some point to add all of the owners on GitHub as owners on npm
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 template.render
behave like the following by default:
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 underscore
and then update this library to show what I mean.
Yup, compile
and render
makes sense and they are convenient as well.
@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 dependencies
array is there so that it is easy for an application to tell when a file needs to be rebuilt. If the user wants caching, they should use the Transformer.compile
interfaces instead of the Transformer.render
interfaces and then they can cache the result of that.
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 :sparkles: markdown-it
:sparkles: - modern pluggable markdown parser
@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 package.json
with authors or have a common author say like jstransformer
.
@hemanth I would argue against that, as 1. package.json
cannot have more than one authors, only maintainers, and 2. not everybody will necessarily be maintaining every module, and adding the person to maintainers
would just be dubious.
@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:
npm owner add forbeslindesay
@ForbesLindesay Done.
@ForbesLindesay that's fine too, but the question is where.
:sparkles: markdown-it
:sparkles: https://github.com/RobLoach/jstransformer-markdown-it
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.
@JosefJezek Markdown It support has been added.
Thank you @TimothyGu and @RobLoach :+1:
:sparkles: eco
:sparkles: https://github.com/RobLoach/jstransformer-eco
:sparkles: swig
:sparkles: https://github.com/RobLoach/jstransformer-swig
@RobLoach I was about to publish swig
heh heh.
:eyes: :tongue:
@RobLoach since you're clearly hooked, I've added you to the owners team :)
@ForbesLindesay Thanks! :+1:
:sparkles: mustache
:sparkles: https://github.com/jstransformers/jstransformer-mustache
:sparkles: plates
:sparkles: http://github.com/jstransformers/jstransformer-plates
@RobLoach nice work! However, remember to enable Coveralls in addition to Travis CI so that the coverage badge works.
:sparkles: ect
:sparkles: https://github.com/jstransformers/jstransformer-ect
:sparkles: atpl
:sparkles: https://github.com/jstransformers/jstransformer-atpl
Also linked the template engines in Forbes original post so that they're easier to find.
:sparkles: dot
:sparkles: https://github.com/jstransformers/jstransformer-dot
count me in, i follow this org since you create it, lol
have some transformers in mind and can help with toffee
, templayed
, mote
and coffeecup
(there have newer impl coffee-templates and mini-coffeecup, i think we can replace legacy 4years coffeecup with them) beside that.. I'll rewrite them asap
@tunnckoCore do you have anything implemented already? If so I can take over those modules right now.
atm nope, tonight (after few hours). just see the issues and lots of new transformers in org and decide to comment immediately :)
HyperScript wouldn't make sense as a jstransformer, would it?
@RobLoach It's just JavaScript. If you really think it would be helpful to do something like:
html
body
:hyperscript
h('p', "why don't you just use Jade?")
, sure. (For me at least it's a waste of time.)
@RobLoach exactly that I have in mind + postcss. on the road
@tunnckoCore welcome to the team. I've added you as an owner and look forward to seeing what you produce :)
I've added rework and postcss to the list :)
@ForbesLindesay thanks! :)
I've added rework and postcss to the list :)
I think we should name it just jstransformer-css
? Im on them now and .. this is the Q.
:sparkles: rework :sparkles: transform CSS to JSON AST using reworkcss/css
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/jstransformer