Skip to content

Instantly share code, notes, and snippets.

@chriscoyier
Created October 21, 2014 01:23
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chriscoyier/f9315fbbe0b5ad80673d to your computer and use it in GitHub Desktop.
Save chriscoyier/f9315fbbe0b5ad80673d to your computer and use it in GitHub Desktop.
Bounty on fixing up Emmet.js for CodeMirror for custom use

Howdy! We use CodeMirror as our editor on CodePen. We also use the Emmet add on for it. We love it. The users love it. It's also very very big at 831k (before compression and stuff).

I've been wanting to optimize it for a while, I've just struggled with it the few times I've tried, and think maybe one of you smart people might be able to do the job more efficiently.

Here's what our custom version of Emmet.js would be like:

  • It would not include it's own copy of Lodash.js, it would just assume that's already available on the page.
  • It would remove everything related to vendor prefixing that's built into Emmet. CodePen offers two prefixing solutions already that are a bit better fit.
  • Remove all the CanIUse information. There is a ton of it in there, and I suspect it's related to the prefixing feature which we're wanting to remove anyway.

Then after that, ensure that everything works exactly as it did before. In the past I've had luck removing things, only to find I'd broken some specific tab trigger or something. Here's a good collection of triggers that should all work.

The repo for it has an index.html demo, so that's a perfect testing ground for all this.

I'd like to offer $500 for the job, if anyone is up for it. But I'd rather not waste a bunch of people's time repeating work, so if you wanna try it, email me at chris@codepen.io so I can kinda coordinate.

@sergeche
Copy link

It would remove everything related to vendor prefixing that's built into Emmet.

You want to remove it completely (e.g. save some bytes) or simply disable it?

@chriscoyier
Copy link
Author

@sergeche remove it completely - reducing the size is the #1 goal.

@chriscoyier
Copy link
Author

This is done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment