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

Typescript support, performance optimization and browser friendly version (no source-map) #164

Open
holblin opened this issue May 26, 2022 · 6 comments

Comments

@holblin
Copy link

holblin commented May 26, 2022

Hi,

I use css for multiple of our projects and I have an issue with the source-map support.
Indeed, due to Webpack 5 and some projects that can't eject from create-react-app, these teams couldn't use CSS (fs can't be polyfilled because Webpack config is not available if you don't eject.).

To solve the issue, I started to fork the project locally and remove the source-map support.
While doing that work I also rewrote some parts of it, moving the project to Typescript and increasing the performance by about 30% in some cases.

Before:
css parse - small x 1,675 ops/sec ±1.00% (89 runs sampled)
css parse - large x 20.37 ops/sec ±1.31% (38 runs sampled)
css parse - huge x 3.17 ops/sec ±2.24% (12 runs sampled)
After:
css parse - small x 2,115 ops/sec ±0.96% (94 runs sampled)
css parse - large x 22.91 ops/sec ±2.02% (42 runs sampled)
css parse - huge x 3.57 ops/sec ±4.45% (13 runs sampled)

How could I contact you (member of rework) to discuss about importing the changes?
@dead-horse @fengmk2 @joakimbeng @jxson @kevva @SlexAxton @tj

@Anutrix
Copy link

Anutrix commented May 27, 2022

A PR is generally the recommended route for this

@holblin
Copy link
Author

holblin commented May 27, 2022

Yes, but the changes are quite important, so before smashing a PR that changes the whole setup, dependencies, and so on I prefer to have a discussion if possible (and that allows me to start discussing while I get agreement from my company).

On top of that, it seems that the member of the rework are currently not very responsive, so I already thinking about creating a fork if I can't get a response.

Lastly, even if I get a PR merged, it's not guaranteed that they will do an npm release ( #151 (comment) ) 👀

@holblin
Copy link
Author

holblin commented Jun 9, 2022

Here is the fork I created: https://github.com/adobe/css-tools
I will release soon a version on npmjs.

@holblin
Copy link
Author

holblin commented Jun 10, 2022

https://www.npmjs.com/package/@adobe/css-tools

@Anutrix
Copy link

Anutrix commented Jun 10, 2022

@holblin Cool. Maybe you can hit up angular team to use your package instead of reworkcss.

@jimblackler
Copy link

Great package @holblin , thank you so much.

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

No branches or pull requests

3 participants