Skip to content

Format WASM generator code to be in line with other clients #223

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

Merged
merged 9 commits into from
May 5, 2025

Conversation

adudek-bw
Copy link
Contributor

๐ŸŽŸ๏ธ Tracking

๐Ÿ“” Objective

Reformatting some of my previous PR to be more in line with the rest of the code

โฐ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation
    team

๐Ÿฆฎ Reviewer guidelines

  • ๐Ÿ‘ (:+1:) or similar for great changes
  • ๐Ÿ“ (:memo:) or โ„น๏ธ (:information_source:) for notes or general info
  • โ“ (:question:) for questions
  • ๐Ÿค” (:thinking:) or ๐Ÿ’ญ (:thought_balloon:) for more open inquiry that's not quite a confirmed
    issue and could potentially benefit from discussion
  • ๐ŸŽจ (:art:) for suggestions / improvements
  • โŒ (:x:) or โš ๏ธ (:warning:) for more significant problems or concerns needing attention
  • ๐ŸŒฑ (:seedling:) or โ™ป๏ธ (:recycle:) for future improvements or indications of technical debt
  • โ› (:pick:) for minor or nitpick changes

@adudek-bw adudek-bw requested a review from a team as a code owner April 23, 2025 16:42
Copy link
Contributor

github-actions bot commented Apr 23, 2025

Logo
Checkmarx One โ€“ Scan Summary & Details โ€“ 0875eb69-9d7e-420c-8723-c3f6cd96c9c7

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented Apr 23, 2025

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.

Project coverage is 68.98%. Comparing base (c6835e5) to head (cdd58c4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/bitwarden-wasm-internal/src/client.rs 0.00% 2 Missing โš ๏ธ
crates/bitwarden-generators/src/username.rs 0.00% 1 Missing โš ๏ธ
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #223      +/-   ##
==========================================
+ Coverage   68.92%   68.98%   +0.05%     
==========================================
  Files         212      211       -1     
  Lines       16126    16112      -14     
==========================================
  Hits        11115    11115              
+ Misses       5011     4997      -14     

โ˜” 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.

@Hinton
Copy link
Member

Hinton commented Apr 25, 2025

suggestion: We're working towards removing the duplicate clients from wasm-internal. Could you take a look at the approach in #222? I think we can use the GeneratorClient from bitwarden-generators directly.

Copy link
Member

@Hinton Hinton left a comment

Choose a reason for hiding this comment

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

I think we should follow the pattern established in https://github.com/bitwarden/sdk-internal/pull/222/files#diff-6cb7ede8c0bc3e55eae30c471bb8f5d2bc385e50d08a604d5855f80a46d7317dR57 and remove generators.rs from wasm-internal and add wasm_bindgen to the generators crate.

@adudek-bw
Copy link
Contributor Author

I think we should follow the pattern established in https://github.com/bitwarden/sdk-internal/pull/222/files#diff-6cb7ede8c0bc3e55eae30c471bb8f5d2bc385e50d08a604d5855f80a46d7317dR57 and remove generators.rs from wasm-internal and add wasm_bindgen to the generators crate.

Just updated! Thanks for the heads up on the new pattern!

Copy link
Member

@dani-garcia dani-garcia left a comment

Choose a reason for hiding this comment

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

I think this is missing the wasm-bindgen-futures = { workspace = true, optional = true } dependency in the bitwarden-generators crate, which is why CI is failing.

This dependency is not used directly by us, but by the code generated by #[cfg_attr(feature = "wasm", wasm_bindgen)] when some functions are async.

@adudek-bw adudek-bw requested review from dani-garcia and Hinton May 1, 2025 14:10
Copy link

sonarqubecloud bot commented May 5, 2025

@adudek-bw adudek-bw merged commit 0872274 into main May 5, 2025
42 checks passed
@adudek-bw adudek-bw deleted the fix-generator-wasm branch May 5, 2025 13:48
coroiu added a commit that referenced this pull request May 6, 2025
## ๐ŸŽŸ๏ธ Tracking

<!-- Paste the link to the Jira or GitHub issue or otherwise describe /
point to where this change is coming from. -->

## ๐Ÿ“” Objective

Fixes: errors introduced by
#223

## โฐ Reminders before review

- Contributor guidelines followed
- All formatters and local linters executed and passed
- Written new unit and / or integration tests where applicable
- Protected functional changes with optionality (feature flags)
- Used internationalization (i18n) for all UI strings
- CI builds passed
- Communicated to DevOps any deployment requirements
- Updated any necessary documentation (Confluence, contributing docs) or
informed the documentation
  team

## ๐Ÿฆฎ Reviewer guidelines

<!-- Suggested interactions but feel free to use (or not) as you desire!
-->

- ๐Ÿ‘ (`:+1:`) or similar for great changes
- ๐Ÿ“ (`:memo:`) or โ„น๏ธ (`:information_source:`) for notes or general info
- โ“ (`:question:`) for questions
- ๐Ÿค” (`:thinking:`) or ๐Ÿ’ญ (`:thought_balloon:`) for more open inquiry
that's not quite a confirmed
  issue and could potentially benefit from discussion
- ๐ŸŽจ (`:art:`) for suggestions / improvements
- โŒ (`:x:`) or โš ๏ธ (`:warning:`) for more significant problems or
concerns needing attention
- ๐ŸŒฑ (`:seedling:`) or โ™ป๏ธ (`:recycle:`) for future improvements or
indications of technical debt
- โ› (`:pick:`) for minor or nitpick changes
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