Closed raveclassic closed 1 year ago
@jsakas would like to hear any feedback on this, thanks! 🙏
Although I appreciate the enthusiasm here, in general coming in and rewriting a project in a new language is not a great way to get started on contributing to it. If you want to create your own fork of this project in a different language, and it is well-maintained, then we'd consider using it in jsdom as an opaque black-box dependency. But it's not something the other people in the jsdom organization would be able to help with; we're a JavaScript project.
Hey folks!
First, thanks for this amazing lib! This makes testing with jsdom a breeze. However, I found some missing features (also referenced here and there in the tracker, like missing support for
calc
,var
and others). I'd like to contribute and finally fix that but I faced some issues with the current state of the codebase, which I'd like to improve first, before I start.First, the code is quite outdated (huh, 3 years without updates), we could definitely fix that by starting with adopting the codebase to the current-date best practices.
The first thing that could be done is upgrading devDependencies (newest eslint, prettier, jest etc.) and then migrating the code to TypeScript for better confidence in the future refactoring (which is required to implement
var
aka custom properties aka--*
properties correctly).So, this PR is the first step towards that and here's the change list:
Object.defineProperties
still work seamlesslyts-morph
valueType
function inparsers
module to return and ADT instead of just a type constant. This allows to keep processed value together with the type eliminating unnecessary type checks.PS. I discovered this library when building some integration tests with
jsdom
for the code that heavily uses custom css properties (plugin for https://github.com/callstack/linaria) and found out that sandy custom css properties are not supported. It's time to fix that!Looking forward to any feedback possible 🙏