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

Rewrite #55

Merged
merged 2 commits into from
Oct 10, 2018
Merged

Rewrite #55

merged 2 commits into from
Oct 10, 2018

Conversation

andyjansson
Copy link
Contributor

@andyjansson andyjansson commented Oct 3, 2018

Why?

The dependencies are poorly maintained and contains a lot of bugs. "Inhousing" the logic would allow us to better maintain the plugin and fix said bugs.

Internal changes

  • Rewrote plugin to house all logic 🎉
  • Updated dependencies
    • Major changes:
      • Upgraded to babel 7
      • Upgraded to ava 1.0.0-beta.8
  • Updated targeted node versions in travis.yml

Outward-facing changes

  • Changed: Updated postcss-selector-parser to version 5.0.0-rc.3
  • Changed: Dropped reduce-css-calc as a dependency
  • Fixed: Support constant() and env() (#42, #48)
  • Fixed: Support custom properties with "calc" in its name (#50)
  • Fixed: Remove unnecessary whitespace around * and / (cssnano#625)
  • Fixed: Arithmetic bugs around subtraction (#49)
  • Fixed: Handling of nested calc statements (reduce-css-calc#49)
  • Fixed: Bugs regarding complex calculations (reduce-cs-calc#45)
  • Fixed: 100% incorrectly being transformed to 1 (reduce-css-calc#44)
  • Added: support for case-insensitive calc statements

@jonathantneal
Copy link
Member

This looks beautifully written. I am 💯 for it. Not sure if anyone else needs to approve, but lemme ping @ai.

@ai
Copy link
Member

ai commented Oct 3, 2018

@jonathantneal I gave @andyjansson access to this repo

@jonathantneal
Copy link
Member

Great! @andyjansson, how can I help you?

@andyjansson
Copy link
Contributor Author

This looks beautifully written. I am 💯 for it.

Glad you like it :)

how can I help you?

Well, it would be a great help if anyone were willing to give it a spin before it goes live.

Copy link
Collaborator

@alexander-akait alexander-akait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job!

@alexander-akait
Copy link
Collaborator

Just note, i i think will be great use snapshots for testing - easy write new tests, better reading, fast writing

@jonathantneal
Copy link
Member

jonathantneal commented Oct 4, 2018

@andyjansson,

(node:70308) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Is this related to the tests + my version of node, or a third-party package issue, or something else?

"postcss-selector-parser": "^2.2.2",
"reduce-css-calc": "^2.0.0"
"postcss-selector-parser": "^5.0.0-rc.3",
"postcss-value-parser": "^3.3.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use postcss-values-parser? I’m trying to get folks to stick with one. AFAIK, it is more frequently updated and respects original whitespace intents better. It is not perfect either, though, so I would not be entirely opposed to sticking with postcss-value-parser.

Copy link
Contributor Author

@andyjansson andyjansson Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

¯\_(ツ)_/¯

I don't really use the parsing for anything else than picking out the calc function. The rest of the parsing is handled internally.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer not to switch to postss-values-parser as it offers no real way of extracting the function for further parsing. It only supplies a bunch of fragments.

@andyjansson
Copy link
Contributor Author

Is this related to the tests + my version of node, or a third-party package issue, or something else?

I saw this, too. I believe it's an issue with yarn, actually. It triggers even if you do something trivial, like "hello": "echo hello". It is not present when executing it via npm.

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

Successfully merging this pull request may close these issues.

4 participants