Skip to content

Conversation

@github-actions
Copy link
Contributor

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to styles/react-19-compatibility, this PR will be updated.

⚠️⚠️⚠️⚠️⚠️⚠️

styles/react-19-compatibility is currently in pre mode so this branch has prereleases rather than normal releases. If you want to exit prereleases, run changeset pre exit on styles/react-19-compatibility.

⚠️⚠️⚠️⚠️⚠️⚠️

Releases

@equinor/fusion-react-styles@2.0.0-preview.0

Major Changes

  • 07a06d2: Remove @material-ui/styles dependency and replace with custom JSS-based implementation for React 19 compatibility.

    ref: React 19: Remove Material-UI from @equinor/fusion-react-styles (v1.0.0) fusion-framework#3698

    Breaking Changes

    • Removed @material-ui/styles dependency - replaced with direct JSS integration
    • All Material-UI v4 styling APIs are now implemented internally
    • No API changes - existing code should work without modifications

    Added

    • Custom makeStyles implementation using JSS directly
    • Custom StylesProvider with enhanced scope isolation via seed prefixes
    • Custom ThemeProvider with React 19 compatibility
    • Comprehensive test suite with Vitest (52 tests, 100% statement coverage)
    • Utility modules in src/utils/:
      • jss-setup.ts - JSS instance configuration
      • class-name-generator.ts - Class name generation logic
      • sheet-manager.ts - Stylesheet caching and management
      • contexts.ts - React context definitions
    • TSDoc documentation for all exported APIs
    • Updated README with comprehensive documentation

    Changed

    • Package now uses JSS directly instead of Material-UI wrapper
    • Improved TypeScript types with better inference
    • Enhanced class name isolation for micro-frontend scenarios

    Technical Details

    • React 19 compatible (tested with React ^18 || ^19)
    • Uses JSS v10 with all necessary plugins
    • Maintains backward compatibility with existing API surface
    • Full test coverage with Vitest and React Testing Library

@equinor/fusion-react-context-selector@2.0.1-preview.0

Patch Changes

  • Updated dependencies [07a06d2]
    • @equinor/fusion-react-styles@2.0.0-preview.0

@equinor/fusion-react-errorboundary@2.0.1-preview.0

Patch Changes

  • Updated dependencies [07a06d2]
    • @equinor/fusion-react-styles@2.0.0-preview.0

@equinor/fusion-react-filter@2.0.1-preview.0

Patch Changes

  • Updated dependencies [07a06d2]
    • @equinor/fusion-react-styles@2.0.0-preview.0

@equinor/fusion-react-hanging-garden@2.0.1-preview.0

Patch Changes

  • Updated dependencies [07a06d2]
    • @equinor/fusion-react-styles@2.0.0-preview.0

@equinor/fusion-react-components-stories@5.0.1-preview.0

Patch Changes

  • f9c381b: Add comprehensive Storybook documentation and stories for @equinor/fusion-react-styles package.

    ref: React 19: Remove Material-UI from @equinor/fusion-react-styles (v1.0.0) fusion-framework#3698

    Added

    • Styles Documentation (styles.mdx): Comprehensive MDX documentation page showcasing all styling features
    • Story Groups: Organized stories into logical groups:
      • Basic Usage: Basic styles, dynamic styles, and theme-based styles
      • Scope Isolation: Demonstrates critical micro-frontend style isolation with nested and side-by-side StylesProvider examples
      • Advanced Features: Nested selectors, multiple style rules, and style caching
      • Theme System: Theme composition and useTheme hook examples
      • Utilities: createStyles helper examples
    • Visual Demonstrations: Interactive stories showing:
      • Class name generation and isolation
      • Dynamic style updates based on props
      • Theme integration
      • CSS features like nested selectors and hover states

    Changed

    • Storybook port updated to 3000
    • Removed @material-ui/styles dependency from Storybook package
  • Updated dependencies [07a06d2]

    • @equinor/fusion-react-styles@2.0.0-preview.0
    • @equinor/fusion-react-context-selector@2.0.1-preview.0
    • @equinor/fusion-react-errorboundary@2.0.1-preview.0
    • @equinor/fusion-react-filter@2.0.1-preview.0
    • @equinor/fusion-react-hanging-garden@2.0.1-preview.0

@github-actions github-actions bot marked this pull request as draft October 31, 2025 23:31
@odinr odinr marked this pull request as ready for review October 31, 2025 23:33
@odinr odinr merged commit fd16fe2 into styles/react-19-compatibility Oct 31, 2025
1 check failed
@odinr odinr deleted the changeset-release/styles/react-19-compatibility branch October 31, 2025 23:33
odinr added a commit that referenced this pull request Nov 3, 2025
#2845)

* feat(styles): remove Material-UI dependency for React 19 compatibility

- Remove @material-ui/styles dependency and replace with custom JSS implementation
- Add comprehensive test suite with Vitest (52 tests, 100% coverage)
- Add TSDoc documentation for all exported APIs
- Update README with comprehensive documentation
- Add utility modules for JSS setup, class name generation, and sheet management
- Enhance StylesProvider with seed-based scope isolation
- Improve TypeScript types with better inference

BREAKING CHANGE: Removed @material-ui/styles dependency

Signed-off-by: Odin Thomas Rochmann <odin.rochmann@gmail.com>

* feat(storybook): add comprehensive styles documentation and stories

- Add MDX documentation page for styles package
- Organize stories into logical groups (Basic Usage, Scope Isolation, Advanced Features, Theme System, Utilities)
- Add visual demonstrations of class name isolation for micro-frontends
- Update Storybook port to 3000
- Remove @material-ui/styles dependency from Storybook

ref: equinor/fusion-framework#3698

* chore: add pre-release workflow for next branch

* chore: add pre-release configuration

* chore: update pnpm-lock.yaml

* Version Packages (preview) (#2846)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: ignore .changeset directory in biome

* chore: add changeset:publish:pre-release script

* fix: forward arguments to changeset:publish:pre-release script

* fix: remove incorrect -- flag from changeset:publish:pre-release

* chore: update packageManager to pnpm@10.20.0

* feat(styles): add theme extension support and improve nested theme composition

- Add support for extending FusionTheme with custom properties using generics
- Enhance createTheme to accept optional baseTheme parameter for nested themes
- Improve deep merging to properly handle StyleProperty instances and Record types
- Export ThemeProviderProps and StylesProviderProps interfaces for better TypeScript support
- Add explicit exports for createTheme, FusionTheme, and StyleDefinition
- Update tests to use createTheme instead of plain objects
- Fix theme merging in nested ThemeProvider scenarios

All changes are backward compatible.

Signed-off-by: Odin Thomas Rochmann <odin.rochmann@gmail.com>

* docs: add TSDoc documentation and update Storybook stories

- Add comprehensive TSDoc comments to all exported functions, types, and interfaces in styles package
- Update all Storybook stories to use theme CSS values instead of custom CSS
- Add ThemeExtension story demonstrating how to extend FusionTheme
- Update changesets to reflect documentation improvements
- Clear pre.json changesets array for re-release

* Version Packages (preview) (#2847)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: update changeset:publish:pre-release script to use dynamic NPM tag

- Modify the changeset:publish:pre-release script in package.json to include a dynamic NPM tag using the environment variable.
- Update GitHub Actions workflow to pass the NPM tag as an environment variable for the publish step.

Signed-off-by: Odin Thomas Rochmann <odin.rochmann@gmail.com>

* chore: configure npm authentication in GitHub Actions workflow

- Add a step to the GitHub Actions workflow to set up npm authentication using the NPM_AUTH_TOKEN secret.
- Ensure the changeset:publish:pre-release script in package.json uses the correct NPM tag format.

Signed-off-by: Odin Thomas Rochmann <odin.rochmann@gmail.com>

* chore: update changesets and add TypeScript definitions

- Remove unused changeset reference from pre.json.
- Add TypeScript definitions path to package.json for better type support.

Signed-off-by: Odin Thomas Rochmann <odin.rochmann@gmail.com>

* Version Packages (preview) (#2848)

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* chore: update version and enhance makeStyles functionality

- Bump version to 2.0.0-preview.3 in package.json.
- Introduce unique identifier generation for makeStyles instances to ensure stylesheet isolation.
- Implement a simple hash function for generating shorter class names in production.
- Update makeStyles to utilize the new unique name generation logic.
- Remove outdated create-styles test file and replace it with a comprehensive test suite in create-styles.test.tsx.

Signed-off-by: Odin Thomas Rochmann <odin.rochmann@gmail.com>

* fix(styles): update theme API usage to getVariable() and improve type safety

- Replace incorrect .css and getAttribute() usage with getVariable() API
- Update all storybook stories to use correct theme property access patterns
- Enhance makeStyles type inference to return Record<ClassKey, string>
- Improve createStyles to preserve literal key types for better type safety
- Update README with comprehensive documentation on theme property access
- Update changesets to reflect correct API usage
- Fix test files to match new API signatures

BREAKING CHANGE: Theme properties now require getVariable() method instead of .css property:
  - Colors: theme.colors.*.getVariable('color')
  - Spacing: theme.spacing.*.getVariable('padding')
  - Typography: theme.typography.*.style.* (unchanged)

The return type of makeStyles is now Record<ClassKey, string> where ClassKey
is inferred from style rules when using createStyles, providing compile-time
type safety for class name access.

* feat(styles): add hot-reload support and improve sheet management

- Add hot-reload detection using style hashing (dev only)
- Implement shared sheet detection to prevent premature detachment
- Simplify scopeId generation and instance naming
- Add warning when name option is missing from makeStyles
- Improve sheet cleanup logic to handle shared sheets correctly
- Update tsconfig to exclude test files from build
- Bump version to 2.0.0-preview.5

* docs(styles): enhance TSDoc comments and inline documentation

- Add comprehensive TSDoc comments to all source files
- Fix all TSDoc examples to use correct theme API (getVariable)
- Add inline maintainer comments explaining complex logic
- Add Biome ignore comments for all explicit 'any' types with proper reasoning
- Update README with validated examples and comprehensive documentation
- Remove ESLint comments (project uses Biome)
- Improve code comments throughout the package for better maintainability

* fix(styles): make Props optional in makeStyles when not specified

Changed default Props type from Record<string, unknown> to {} in makeStyles overloads.
This ensures keyof Props evaluates to never when Props is empty, making the
conditional type return (props?: Props) instead of requiring props.

Fixes build errors where useStyles() was called without arguments but TypeScript
required props parameter.

* Update .changeset/react-styles-theme-extensions.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* chore: exit pre-release mode

* chore: reset package versions and changelogs to main

* chore: regen lockfile

Signed-off-by: Odin Thomas Rochmann <odin.rochmann@gmail.com>

---------

Signed-off-by: Odin Thomas Rochmann <odin.rochmann@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

Successfully merging this pull request may close these issues.

2 participants