Skip to content
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

Do we need better stringifier ? #44

Closed
MoOx opened this issue Jul 27, 2014 · 5 comments
Closed

Do we need better stringifier ? #44

MoOx opened this issue Jul 27, 2014 · 5 comments

Comments

@MoOx
Copy link
Contributor

MoOx commented Jul 27, 2014

Parsing this

@keyframes kf {
  0% { opacity: 0 }
  25% { opacity: 0 } /* keep 0 to 25% of the timing to simulates a delay */
  100% { opacity: 1 }
}

Give that stringified

@keyframes kf {
  0% {
    opacity: 0;
  }

  25% {
    opacity: 0;
  }

  /* keep 0 to 25% of the timing to simulates a delay */
  100% {
    opacity: 1;
  }
}

This is weird.

What is the reason we just don't keep the code as is like postcss does ? Is there any ?

@conradz
Copy link
Contributor

conradz commented Jul 28, 2014

Is there any reason to keep the source format now that we have source maps? I pretty much never look at the generated source code, so IMO I don't care how it looks.

@MoOx
Copy link
Contributor Author

MoOx commented Jul 28, 2014

I totally get the "i don't look so i don't care", but it just sounds stupid to me (stupid to change whitespace, I understand your point of view, since most of the time (98%) I never checkout output).
But in that way postcss is doing a better job at keeping author coding style.
I'm working on a playground for myth.io website (so people can try & get live output) & I would like to just keep author preferences to make minimal changes (like postcss does when you use autoprefixer for example).

@necolas
Copy link
Contributor

necolas commented Jul 28, 2014

it's a lot of changes for a relatively trivial use case though. it's not that this module intentionally changes whitespace, it's that preserving it is extra complexity.

@lydell
Copy link
Contributor

lydell commented Jul 28, 2014

It would not be enough to change the stringifier. The parser would need changes as well.

However, what's the point of doing things just like postcss? Then we could just use postcss instead, couldn't we?

Recently I've had a really hard time choosing between rework and postcss. Since postcss has been rewritten in JavaScript (no more CoffeeScript) I've started to lean to it ...

@MoOx
Copy link
Contributor Author

MoOx commented Jul 28, 2014

@lydell I'll probably do the same so. That would involve rewriting all current plugins used by myth as postcss plugins. Ouch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants