cssinjs / jss

JSS is an authoring tool for CSS which uses JavaScript as a host language.
https://cssinjs.org
MIT License
7.06k stars 397 forks source link

Extract CSSOM/DOM related utilities into a separate package #744

Open kof opened 5 years ago

kof commented 5 years ago

As a first step of moving to jest, we need to separate the code that needs karma and cross-browser testing, since jest doesn't support that.

We can create a small functional utility belt for CSSinJS libraries that encapsulates all the CSSOM/DOM logic and we can use the current karma setup for this library.

Needed also for https://github.com/cssinjs/jss/issues/745

kof commented 5 years ago

Should this package be part of the monorepo? I tend to "no" for 2 reasons:

HenriBeck commented 5 years ago

Yeah, I would agree to not have karma and jest in this monorepo.

kof commented 5 years ago

Also if there is no easy way to setup karma with rollup, we could keep the current webpack config with karma in that separate repo, since it won't be often updated and neither its lots of code.

HenriBeck commented 5 years ago

Any idea for naming this package?

kof commented 5 years ago

cssinjs-utils is free

kof commented 5 years ago

mb cssom-utils is even better

HenriBeck commented 5 years ago

yeah cssom-utils is better

HenriBeck commented 5 years ago

@kof could you get started on this? That way we wouldn't need a separate test script for the babel plugin

kof commented 5 years ago

I want to finish babel and webpack plugins first. To kick start this we could discuss all functions that we would need to extract from JSS.

HenriBeck commented 5 years ago

I think the functions are mostly/all in https://github.com/cssinjs/jss/blob/master/packages/jss/src/renderers/DomRenderer.js

kof commented 5 years ago

Yes, but we will have to remove any JSS specific logic/knowledge from them to make them universal.

HenriBeck commented 5 years ago

Let's make a plan for this to move forward on switching the test setup to jest.

kof commented 5 years ago

I would say that someone needs to identify generic utilities (dom/cssom) needed in DOMRenderer and describe the interfaces of them. Then once its discussed move forward with implementation and releasing a package.