Skip to content

Move postcss plugin back into monorepo#393

Closed
necolas wants to merge 1 commit into
mainfrom
postcss-plugin
Closed

Move postcss plugin back into monorepo#393
necolas wants to merge 1 commit into
mainfrom
postcss-plugin

Conversation

@necolas

@necolas necolas commented Sep 18, 2025

Copy link
Copy Markdown
Contributor

Allows for configuration to be simplified, and avoids confusing need to mix react-strict-dom and stylex names.

@meta-cla meta-cla Bot added the cla signed label Sep 18, 2025
@github-actions

Copy link
Copy Markdown

workflow: benchmarks/size

Comparison of minified (terser) and compressed (brotli) size results, measured in bytes. Smaller is better.

Results Base Patch Ratio
react-strict-dom/dist/web/index.js
· compressed 2,490 2,490 1.00
· minified 8,653 8,653 1.00
react-strict-dom/dist/web/runtime.js
· compressed 855 855 1.00
· minified 2,435 2,435 1.00
react-strict-dom/dist/native/index.js
· compressed 16,195 16,195 1.00
· minified 62,798 62,798 1.00

@github-actions

github-actions Bot commented Sep 18, 2025

Copy link
Copy Markdown

workflow: benchmarks/perf (native)

Comparison of performance test results, measured in operations per second. Larger is better.

Results Base Patch Ratio
css.create
· small 1,143,691 1,123,115 0.98 -
· small with units 492,737 488,635 0.99 -
· small with variables 666,822 670,766 1.01 +
· several small 351,324 351,512 1.00 +
· large 200,682 200,951 1.00 +
· large with polyfills 147,853 150,430 1.02 +
· complex 102,248 103,664 1.01 +
· unsupported 210,809 211,547 1.00 +
css.createTheme
· simple theme 224,259 224,764 1.00 +
· polyfill theme 212,717 214,047 1.01 +
css.props
· small 229,587 229,062 1.00 -
· small with units 187,048 187,470 1.00 +
· small with variables 112,603 112,060 1.00 -
· small with variables of units 82,283 82,406 1.00 +
· large 96,716 96,509 1.00 -
· large with polyfills 38,107 38,242 1.00 +
· complex 21,744 22,021 1.01 +
· unsupported 140,661 140,429 1.00 -
· simple merge 158,888 158,914 1.00 +
· wide merge 16,751 16,958 1.01 +
· deep merge 16,466 16,635 1.01 +
· themed merge 32,835 32,875 1.00 +

@necolas

necolas commented Sep 18, 2025

Copy link
Copy Markdown
Contributor Author

@javascripter Are you open to transferring the npm package name so I can publish this package in sync with RSD going forward?

Comment thread packages/website/docs/learn/environment-setup/02-next.md Outdated
@javascripter

javascripter commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

@javascripter Are you open to transferring the npm package name so I can publish this package in sync with RSD going forward?

@necolas Yes no problem transferring postcss-react-strict-dom npm package name on my side.
Let me know of the npm usernames to transfer to so I can add as maintainers. When you've confirmed you can publish under the package name I can remove myself from the maintainers to finish transfer.

@necolas

necolas commented Sep 22, 2025

Copy link
Copy Markdown
Contributor Author

Just @necolas for now please. Thanks!

@javascripter

Copy link
Copy Markdown
Contributor

@necolas Sent an invite!

Allows for configuration to be simplified, and avoids confusing need to
mix react-strict-dom and stylex names.

// Determines if the source code should be transformed
function shouldTransform(sourceCode) {
return sourceCode.includes('react-strict-dom');

@javascripter javascripter Sep 24, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there an edge case where some files without react-strict-dom string must still be transformed due to variables?

Something like the below:

src/index.ts:

import { colors } from './vars.stylex';
import { Text } from './text';

// No direct react-strict-dom imports, but still needs transformations due to vars?

export default function App() {
  return <Text color={colors.primary}>Hello</Text>
}

src/text.tsx:

import { html , css } from 'react-strict-dom';
export function Text({ color, style, ...props} ) { 
  return <html.div style={[styles.text(color), style]} {...props} />
}

const styles = css.create({
  text: (color) => ({
    color
  })
})

src/vars.stylex.ts:

import { css } from 'react-strict-dom'

export const colors = stylex.defineVars({
  primary: 'green'
});

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the variable files are processed based on their name rather than being imported. But we can include this pattern in the test app to know for sure

@necolas necolas closed this in 945bf94 Sep 29, 2025
@necolas necolas deleted the postcss-plugin branch October 2, 2025 19:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants