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

Cleanup of the frontend code #1563

Merged
merged 1 commit into from
Jan 9, 2023
Merged

Cleanup of the frontend code #1563

merged 1 commit into from
Jan 9, 2023

Conversation

paskal
Copy link
Sponsor Collaborator

@paskal paskal commented Jan 8, 2023

  • replace undocumented substr with substring
  • remove unused code
  • inline a few variables
  • simplify ifs when possible
  • improve saveCollapsedComments documentation
  • cleanup the unused imports
  • remove unused variables and types

@codecov
Copy link

codecov bot commented Jan 8, 2023

Codecov Report

Base: 58.05% // Head: 58.45% // Increases project coverage by +0.40% 🎉

Coverage data is based on head (3d12f07) compared to base (82f27e6).
Patch coverage: 80.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1563      +/-   ##
==========================================
+ Coverage   58.05%   58.45%   +0.40%     
==========================================
  Files         131      128       -3     
  Lines        2911     2879      -32     
  Branches      736      729       -7     
==========================================
- Hits         1690     1683       -7     
+ Misses       1090     1070      -20     
+ Partials      131      126       -5     
Impacted Files Coverage Δ
frontend/apps/remark42/app/common/api.ts 72.09% <ø> (-0.64%) ⬇️
frontend/apps/remark42/app/common/cookies.ts 21.05% <ø> (-2.76%) ⬇️
frontend/apps/remark42/app/common/types.ts 100.00% <ø> (ø)
...ribe-by-email/comment-form__subscribe-by-email.tsx 90.59% <ø> (ø)
...rontend/apps/remark42/app/components/root/root.tsx 0.00% <ø> (ø)
...apps/remark42/app/components/settings/settings.tsx 0.00% <0.00%> (ø)
...ontend/apps/remark42/app/utils/replaceSelection.ts 50.00% <0.00%> (ø)
frontend/apps/remark42/app/common/fetcher.ts 94.82% <100.00%> (-0.09%) ⬇️
...nd/apps/remark42/app/components/auth/auth.hooks.ts 89.74% <100.00%> (-1.29%) ⬇️
...ark42/app/components/comment-form/comment-form.tsx 51.70% <100.00%> (ø)
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@github-actions
Copy link

github-actions bot commented Jan 8, 2023

size-limit report 📦

Path Size
public/embed.mjs 2.03 KB (0%)
public/remark.mjs 72.67 KB (-0.12% 🔽)
public/remark.css 8.12 KB (-0.02% 🔽)
public/last-comments.mjs 35.62 KB (-0.14% 🔽)
public/last-comments.css 3.72 KB (-0.03% 🔽)
public/deleteme.mjs 12.04 KB (-0.03% 🔽)
public/counter.mjs 749 B (0%)

@paskal paskal force-pushed the paskal/frontend_cleanup branch 2 times, most recently from 7770922 to 9c2c2f1 Compare January 8, 2023 13:13
Copy link
Collaborator

@akellbl4 akellbl4 left a comment

Choose a reason for hiding this comment

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

@paskal I like those changes. I wrote few points which we should fix before merging it.

@akellbl4
Copy link
Collaborator

akellbl4 commented Jan 8, 2023

I just realized that you tried to address #1321. I'd say it's less than ideal way of addressing it, so I'd rather leave ts-ignore because assertions is nothing better that ignores because types are still unsafe.

@paskal paskal force-pushed the paskal/frontend_cleanup branch 2 times, most recently from df8f9f7 to dc70976 Compare January 8, 2023 18:38
@paskal paskal requested a review from akellbl4 January 8, 2023 18:38
- replace undocumented `substr` with `substring`
- remove unused code
- inline a few variables
- simplify ifs when possible
- improve saveCollapsedComments documentation
- cleanup the unused imports
- remove unused variables and types
Copy link
Collaborator

@akellbl4 akellbl4 left a comment

Choose a reason for hiding this comment

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

@paskal nice job!

@paskal paskal merged commit d6cce8d into master Jan 9, 2023
@paskal paskal deleted the paskal/frontend_cleanup branch January 9, 2023 21:16
@paskal paskal added this to the v1.11.3 milestone Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants