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

Refactor: generate terms page from md file #4183

Merged
merged 4 commits into from
Sep 19, 2024
Merged

Conversation

compojoom
Copy link
Collaborator

What it solves

It's very cumbersome to update the Terms page as it is in html and we have to find the changed areas and make sure to correctly update them. Instead with this change we can always export the complete terms document to md and then leave it to remark to render it as html

Resolves #

How this PR fixes it

How to test it

Screenshots

Checklist

  • I've tested the branch on mobile 📱
  • I've documented how it affects the analytics (if at all) 📊
  • I've written a unit/e2e test for it (if applicable) 🧑‍💻

Copy link

github-actions bot commented Sep 16, 2024

Copy link

github-actions bot commented Sep 16, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

Copy link

github-actions bot commented Sep 16, 2024

📦 Next.js Bundle Analysis for safe-wallet-web

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 953.92 KB (🟡 +14.4 KB)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Twenty-five Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load
/address-book 26.1 KB (🟡 +1 B) 980.02 KB
/apps 50.18 KB (-5 B) 1004.1 KB
/apps/custom 41.81 KB (🟢 -8 B) 995.74 KB
/apps/open 54.73 KB (🟡 +1 B) 1008.65 KB
/balances 30.66 KB (🟢 -7 B) 984.58 KB
/balances/nfts 19.18 KB (🟢 -5 B) 973.1 KB
/home 60.21 KB (-2 B) 1014.14 KB
/new-safe/advanced-create 35.14 KB (-3 B) 989.07 KB
/new-safe/create 34.41 KB (🟡 +1 B) 988.33 KB
/new-safe/load 16.41 KB (🟢 -2 B) 970.34 KB
/settings/cookies 7.66 KB (🟢 -1 B) 961.59 KB
/settings/data 7.56 KB (🟢 -1 B) 961.49 KB
/settings/environment-variables 9.15 KB (🟢 -3 B) 963.07 KB
/settings/safe-apps 25.56 KB (-1 B) 979.49 KB
/settings/security 8.08 KB (🟢 -1 B) 962.01 KB
/settings/setup 35.98 KB (🟢 -5 B) 989.9 KB
/share/safe-app 9.72 KB (🟡 +1 B) 963.65 KB
/stake 602 B (🟡 +1 B) 954.51 KB
/terms 544 B (🟢 -10.66 KB) 954.46 KB
/transactions 73.52 KB (-2 B) 1 MB
/transactions/history 73.48 KB (-3 B) 1 MB
/transactions/messages 39.16 KB (-4 B) 993.08 KB
/transactions/msg 29.51 KB (-2 B) 983.43 KB
/transactions/tx 21.06 KB (🟡 +1 B) 974.99 KB
/welcome 6.77 KB (🟢 -2 B) 960.7 KB
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

Next to the size is how much the size has increased or decreased compared with the base branch of this PR. If this percentage has increased by 20% or more, there will be a red status indicator applied, indicating that special attention should be given to this.

Copy link

github-actions bot commented Sep 16, 2024

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.24% (+0.01% 🔼)
11984/15316
🔴 Branches
58.29% (+0.02% 🔼)
3079/5282
🟡 Functions
65.35% (-0.01% 🔻)
1890/2892
🟡 Lines
79.76% (+0.02% 🔼)
10817/13562
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢 mocks/terms.md.js 75% 100% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟡
... / cookiesAndTermsSlice.ts
52.38% (-11.26% 🔻)
33.33% (-66.67% 🔻)
20% (-13.33% 🔻)
64.29% (-21.43% 🔻)

Test suite run success

1485 tests passing in 203 suites.

Report generated by 🧪jest coverage report action from 93aca16

Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

Looks great but we should move some (all?) of these new dependencies in devDependencies. Nonce of them seem to be imported in any runtime module.

@katspaugh katspaugh changed the title feat: generate terms page from md file Refactor: generate terms page from md file Sep 16, 2024
@compojoom compojoom force-pushed the feat-terms-from-md branch 2 times, most recently from ce857e2 to 3a4d36c Compare September 16, 2024 14:30
Copy link
Member

@katspaugh katspaugh left a comment

Choose a reason for hiding this comment

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

🔥

The cookie banner now shows the last updated version. In addition to this
it is no longer necessary to update the version number inside of the
store slice. We can control it from the frontmatter of the terms.md doc.

Whenever the version gets updated the cookie banner is going to pop up.
Copy link

github-actions bot commented Sep 18, 2024

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@compojoom compojoom merged commit 20f0625 into dev Sep 19, 2024
16 checks passed
@compojoom compojoom deleted the feat-terms-from-md branch September 19, 2024 07:41
@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants