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

chore: setup utilities package #17280

Merged
merged 15 commits into from
Sep 21, 2024

Conversation

janhassel
Copy link
Member

@janhassel janhassel commented Aug 27, 2024

Ref #16243

Changelog

New

  • Set up new package: @carbon/utilities
    • Add dateTimeFormat module to it
  • Set up new package: @carbon/utilities-react
    • Copy useNoInteractiveChildren from @carbon/react as a starter

Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for carbon-elements ready!

Name Link
🔨 Latest commit 9d3f71b
🔍 Latest deploy log https://app.netlify.com/sites/carbon-elements/deploys/66ee7ee6868a650008de8c72
😎 Deploy Preview https://deploy-preview-17280--carbon-elements.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 site configuration.

Copy link

netlify bot commented Aug 27, 2024

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 9d3f71b
🔍 Latest deploy log https://app.netlify.com/sites/v11-carbon-react/deploys/66ee7ee678ae0f00088bf241
😎 Deploy Preview https://deploy-preview-17280--v11-carbon-react.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 site configuration.

Copy link
Member

@mattrosno mattrosno left a comment

Choose a reason for hiding this comment

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

I added the project IDs here and some comments about the Telemetry package versions. Everything else looks good.

Reviewing this, https://github.com/ibm-telemetry/telemetry-config-schema?tab=readme-ov-file#js-scope, it's unclear to me if we want to set allowedArgumentStringValues in the JS functions configuration. I guess we can wait to see if we're capturing function arguments and if so, we can allowlist values like "long", "short", "narrow", etc. These are only for string arguments thought, and it looks like you're passing in locale and style in an object parameter, so given current Telemetry functionality, I don't think it's possible to track parameters here.

Also, I was going to suggest adding the jsx config to the React package, but it doesn't have components, just hooks, and the js scope with functions will capture React hooks so we're good there.

packages/utilities-react/telemetry.yml Outdated Show resolved Hide resolved
packages/utilities/telemetry.yml Outdated Show resolved Hide resolved
packages/utilities-react/package.json Outdated Show resolved Hide resolved
packages/utilities/package.json Outdated Show resolved Hide resolved
@janhassel
Copy link
Member Author

@mattrosno

I guess we can wait to see if we're capturing function arguments and if so, we can allowlist values like "long", "short", "narrow", etc.

Will this actually work since these string values are passed as part of an object?

@janhassel janhassel marked this pull request as ready for review September 2, 2024 08:27
@janhassel janhassel requested a review from a team as a code owner September 2, 2024 08:27
@mattrosno
Copy link
Member

Will this actually work since these string values are passed as part of an object?

@janhassel unfortunately no, as we only capture booleans, numbers, and allowed strings. We didn't have a secure way to capture object values.

Copy link
Member

@emyarod emyarod left a comment

Choose a reason for hiding this comment

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

looks good to me!

Copy link
Member

@tay1orjones tay1orjones left a comment

Choose a reason for hiding this comment

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

LGTM, thanks again for doing this! 🎉

Copy link

codecov bot commented Sep 16, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.03%. Comparing base (1ad4256) to head (9d3f71b).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #17280   +/-   ##
=======================================
  Coverage   77.03%   77.03%           
=======================================
  Files         408      408           
  Lines       13979    13979           
  Branches     4339     4339           
=======================================
  Hits        10769    10769           
  Misses       3037     3037           
  Partials      173      173           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@tay1orjones tay1orjones added this pull request to the merge queue Sep 21, 2024
Merged via the queue into carbon-design-system:main with commit fd2495b Sep 21, 2024
22 of 23 checks passed
@janhassel janhassel deleted the carbon-utilities branch October 7, 2024 08:04
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.

5 participants