Skip to content

Releases: hoangnhan2ka3/twg

v2.0.1

27 Aug 03:21
Compare
Choose a tag to compare

Chore

  • Remove unused console.log in src/processor/ast.ts.

Full Changelog: v2.0.0...v2.0.1

🎉 v2.0.0

27 Aug 03:13
Compare
Choose a tag to compare

Core change

  • Use @babel AST to parse all conditional classes, objects, arrays or even both string and array.
    • Pros:
      • More accurate, more trust in processing.
      • Works perfectly even with complex conditionals like nested ternary and inside template literal.
      • Reduce several complex regex use to parse condition.
      • Lighter bundle.
    • Cons:
      • Currently work on (.js, .ts, .jsx, .tsx) file only.
      • A bit slower, especially on the first time, when nothing is cached.
      • 4 more dependencies 😢
  • Supports native objects behavior like clsx (Key as classes and value as conditionals) [docs].
  • Refactor lite version of parser() function to accept new objects behavior.

Chore

  • Add more test cases for new objects behavior.
  • Fixed npm README's shields links.
  • Bump dependencies version.

Misc

  • Deleted unused (e) in catch block of lite version of replacer() function.

Full Changelog: v1.2.6...v2.0.0

v1.2.6

24 Aug 13:24
Compare
Choose a tag to compare

Refactor

  • Revert const char = content[i] in v1.2.4 refactor of extractor() function, which caused error on v1.2.5.

Chore

  • Add more test cases for extractor() function.
  • Update npm README.

Full Changelog: v1.2.5...v1.2.6

v1.2.5

24 Aug 12:37
Compare
Choose a tag to compare

Core change

  • Return original content whenever callee option is not valid, instead of being overridden by default value.

Refactor

  • Revert v1.2.3 refactor, because reducer() doesn't need to regenerate every time the parser() is called.
  • Fixed debug message duplicated ":" typo.

Chore

  • Fixed some test cases in context of core change.
  • Temporarily remove Ko-fi funding button in README, because of PayPal error.

Full Changelog: v1.2.4...v1.2.5

v1.2.4

24 Aug 08:04
Compare
Choose a tag to compare

Refactor

  • Refactor extractor() function.
  • Export replacer() as both default and named export.

Chore

  • Fixed typo in README.
  • Update bundle shield links in npm README.

Full Changelog: v1.2.3...v1.2.4

v1.2.3

24 Aug 07:35
Compare
Choose a tag to compare

Core change

  • Collapses reducer() into parser() function.
  • Improves reducer() function, does not need to handle Array anymore.

Refactor

  • Refactor lite parser() function.

Chore

  • Test also lite replacer() and twg() function.
  • Add more test cases.

Full Changelog: v1.2.2...v1.2.3

v1.2.2

24 Aug 02:44
Compare
Choose a tag to compare

Chore

  • Move GitHub README to .github to reduce package size on npm.

Full Changelog: v1.2.1...v1.2.2

v1.2.1

23 Aug 13:13
Compare
Choose a tag to compare

Chore

  • Update .npmignore to ignore /public folder.
  • Update funding button in README

Full Changelog: v1.2.0...v1.2.1

v1.2.0

23 Aug 11:30
Compare
Choose a tag to compare

Core change

  • Change the behavior of extractor() to scan also callee function and outer object(s) inside it.
  • Doesn't need regex to match callee function anymore.
  • Lead to API change in replacer() options, now matchFunction is deprecated.
  • New replacer() options: debug. Now user can turn off debug message right in options.

Refactor

  • Update README to satisfied new API changes.
  • Add section about Tailwind CSS IntelliSense in trade-offs of README.
  • refactor folder structure for readability and clean function name.

Chore

  • Add more test cases, especially ternary and multiple consequent parts of ternary and and-or conditionals.

Misc

  • Update all packages to latest version, delete unused files.

Full Changelog: v1.1.2...v1.2.0

v2.0.0-beta.1

22 Aug 04:05
Compare
Choose a tag to compare
v2.0.0-beta.1 Pre-release
Pre-release

Core change

  • Use @babel AST to parse all conditional classes or conditional objects.
    • Pros:
      • More accurate, more trust in processing.
      • Reduce several complex regex use to parse condition.
      • Lighter bundle.
    • Cons:
      • Currently work on (.jsx, .tsx file) only.
      • A bit slower, especially on the first time, when nothing is cached.
      • 4 more dependencies.

Full Changelog: v1.1.0...v2.0.0-beta.1