Releases: hoangnhan2ka3/twg
Releases · hoangnhan2ka3/twg
v2.0.1
🎉 v2.0.0
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 😢
- Pros:
- 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 ofreplacer()
function.
Full Changelog: v1.2.6...v2.0.0
v1.2.6
Refactor
- Revert
const char = content[i]
inv1.2.4
refactor ofextractor()
function, which caused error onv1.2.5
.
Chore
- Add more test cases for
extractor()
function. - Update npm README.
Full Changelog: v1.2.5...v1.2.6
v1.2.5
Core change
- Return original
content
whenevercallee
option is not valid, instead of being overridden by default value.
Refactor
- Revert
v1.2.3
refactor, becausereducer()
doesn't need to regenerate every time theparser()
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
Refactor
- Refactor
extractor()
function. - Export
replacer()
as bothdefault
andnamed
export.
Chore
- Fixed typo in README.
- Update bundle shield links in npm README.
Full Changelog: v1.2.3...v1.2.4
v1.2.3
Core change
- Collapses
reducer()
intoparser()
function. - Improves
reducer()
function, does not need to handle Array anymore.
Refactor
- Refactor lite
parser()
function.
Chore
- Test also lite
replacer()
andtwg()
function. - Add more test cases.
Full Changelog: v1.2.2...v1.2.3
v1.2.2
v1.2.1
Chore
- Update
.npmignore
to ignore/public
folder. - Update funding button in README
Full Changelog: v1.2.0...v1.2.1
v1.2.0
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, nowmatchFunction
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
intrade-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
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.
- Pros:
Full Changelog: v1.1.0...v2.0.0-beta.1