base-ui icon indicating copy to clipboard operation
base-ui copied to clipboard

[infra] Extract utilities to a separate package

Open michaldudak opened this issue 5 months ago • 5 comments

Extracted utilities that can be used in other MUI projects to a separate library - @base-ui-components/utils.

Before we start using it across the company, I want to update JSDocs and possibly rename and reorganize few utilities.

michaldudak avatar Jun 25 '25 15:06 michaldudak

Bundle size report

Bundle Parsed Size Gzip Size
@base-ui-components/react ▼-295B(-0.10%) ▼-124B(-0.13%)

Details of bundle changes

Generated by :no_entry_sign: dangerJS against c4c063ac2700c85bfe344a633aa2c984be24a81a

mui-bot avatar Jun 25 '25 15:06 mui-bot

can be used in other MUI projects to a separate library

That means they will be semver stable? Should we document them?

cc @romgrk to get your attention on this PR, I believe you brought up the topic of shared libraries recently.

Janpot avatar Jun 25 '25 16:06 Janpot

vite-css-base-ui-example

npm i https://pkg.pr.new/@base-ui-components/react@2167
npm i https://pkg.pr.new/@base-ui-components/utils@2167

commit: c4c063a

pkg-pr-new[bot] avatar Jun 26 '25 09:06 pkg-pr-new[bot]

Deploy Preview for base-ui ready!

Name Link
Latest commit c4c063ac2700c85bfe344a633aa2c984be24a81a
Latest deploy log https://app.netlify.com/projects/base-ui/deploys/6870c96a87c30f00088628cc
Deploy Preview https://deploy-preview-2167--base-ui.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

netlify[bot] avatar Jun 26 '25 09:06 netlify[bot]

Tested the release process and uploaded https://www.npmjs.com/package/@base-ui-components/utils

michaldudak avatar Jun 26 '25 12:06 michaldudak

Have you considered exporting useButton hook? 🤔

We might actually have a Button component at some point, but it's not fully decided yet. If you need to add button functions to a non-interactive component, I suppose useButton could be useful. However, before we export it, I'd like to clean it up properly and remove handling of HTML anchors (we could have useLink if there's a need, but I don't see it now).

michaldudak avatar Jul 09 '25 09:07 michaldudak