Skip to content

Conversation

@acelaya
Copy link
Contributor

@acelaya acelaya commented Jun 9, 2025

Part of hypothesis/h#9548

This is a follow-up of #7140, which replaces the local src/annotation-ui contents with the @hypothesis/annotation-ui library from hypothesis/annotation-ui#1

It also removes @rollup/plugin-alias and all the aliasing config which is no longer needed.

@acelaya acelaya requested a review from robertknight June 9, 2025 10:59
@acelaya acelaya force-pushed the annotation-ui-lib branch from 779739a to 966c859 Compare June 9, 2025 11:00
// UI (Preact) Components
// ----------
@use '../../../annotation-ui/StyledText';
@use '@hypothesis/annotation-ui/lib/StyledText.css';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was hoping this would work as @hypothesis/annotation-ui/StyledText.css, but it doesn't. I reckon this is not terrible anyway.

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know why it isn't working? Does SASS not support the exports field in package.json?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does SASS not support the exports field in package.json?

Yeah, I think so. I'm even not sure it's standard to expose a stylesheet via exports or it's just a "hack" used by tailwind that bundlers happen to understand. I haven't been able to confirm this yet.

@codecov
Copy link

codecov bot commented Jun 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.45%. Comparing base (45964e3) to head (966c859).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7151      +/-   ##
==========================================
+ Coverage   99.39%   99.45%   +0.06%     
==========================================
  Files         281      271      -10     
  Lines       11386    11012     -374     
  Branches     2750     2638     -112     
==========================================
- Hits        11317    10952     -365     
+ Misses         69       60       -9     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

// UI (Preact) Components
// ----------
@use '../../../annotation-ui/StyledText';
@use '@hypothesis/annotation-ui/lib/StyledText.css';
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know why it isn't working? Does SASS not support the exports field in package.json?

peerDependencies:
"@hypothesis/frontend-shared": ^9.4.0
dompurify: ^3.0.0
escape-html: ^1.0.3
Copy link
Contributor

Choose a reason for hiding this comment

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

Only @hypothesis/frontend-shared really needs to be a peer dependency here. None of the others are used by the client outside of annotation UI rendering.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True.

On the other hand, having them as peer dependencies allows for dependabot to provide updates for those packages on every individual project. I reckon it does not if they are dependencies of a dependency.

@acelaya acelaya merged commit 2e2cf6b into main Jun 9, 2025
4 checks passed
@acelaya acelaya deleted the annotation-ui-lib branch June 9, 2025 12:19
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.

3 participants