Skip to content

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

Description

@holblin

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

Activity

  1. Anutrix commented on May 27, 2022

    @Anutrix

    A PR is generally the recommended route for this

  2. holblin commented on May 27, 2022

    @holblin
    Author

    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) ) 👀

  3. holblin commented on Jun 9, 2022

    @holblin
    Author

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

  4. holblin commented on Jun 10, 2022

    @holblin
    Author
  5. Anutrix commented on Jun 10, 2022

    @Anutrix

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

  6. jimblackler commented on Dec 4, 2022

    @jimblackler

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions