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

feat: introduce donation links in update flow #2581

Merged
merged 3 commits into from
Dec 2, 2024

Conversation

giacomocusinato
Copy link
Collaborator

@giacomocusinato giacomocusinato commented Nov 26, 2024

Motivation

  • Add footer to IDEUpdaterDialog with donate link
  • Show donate dialog if first instance of a new version of the IDE is running

Change description

Other information

Reviewer checklist

  • PR addresses a single concern.
  • The PR has no duplicates (please search among the Pull Requests before creating one)
  • PR title and description are properly filled.
  • Docs have been added / updated (for bug fixes / features)

@giacomocusinato giacomocusinato changed the title Donate link on update feat: introduce donate dialog Nov 26, 2024
@giacomocusinato giacomocusinato force-pushed the donate-link-on-update branch 4 times, most recently from d386d3c to 491eca7 Compare November 26, 2024 22:42
@giacomocusinato giacomocusinato changed the title feat: introduce donate dialog feat: introduce donation links in update flow Nov 26, 2024
@giacomocusinato giacomocusinato marked this pull request as ready for review November 26, 2024 22:46
@giacomocusinato giacomocusinato force-pushed the donate-link-on-update branch 7 times, most recently from 1721908 to 7eae0db Compare November 27, 2024 12:07
@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Nov 27, 2024
Comment on lines 90 to 98
this.titleNode.innerHTML = nls.localize(
'arduino/versionWelcome/titleWithVersion',
'Welcome to the new Arduino IDE {0}!',
appVersion
);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

The IDE might want to purify the HTML here for security reasons. One can submit an executable translation that will be merged without notice. dompurify is already available from Theia's dependencies.

yarn why dompurify
yarn why v1.21.1
[1/4] 🤔  Why do we have the module "dompurify"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] 🔍  Finding dependency...
[4/4] 🚡  Calculating file sizes...
=> Found "[email protected]"
info Reasons this module exists
   - "_project_#arduino-ide-extension#@theia#core" depends on it
   - Hoisted from "_project_#arduino-ide-extension#@theia#core#dompurify"
info Disk size without dependencies: "740KB"
info Disk size with unique dependencies: "740KB"
info Disk size with transitive dependencies: "740KB"
info Number of shared dependencies: 0
✨  Done in 1.05s.

Pinning it in the package.json and purifying the HTML should not hurt. What do you think?

Copy link
Collaborator Author

@giacomocusinato giacomocusinato Dec 2, 2024

Choose a reason for hiding this comment

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

I've changed this specific statement to use innerText instead of innerHTML which was unnecessary.
This should already pretty be safe but I might keep the sanitizer anyway

Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Thanks Giacomo!

Show donate dialog after the first time a first IDE version is loaded
Pin same version of `dompurify` used in Theia
@giacomocusinato giacomocusinato merged commit 8e18c47 into main Dec 2, 2024
46 checks passed
@giacomocusinato giacomocusinato deleted the donate-link-on-update branch December 2, 2024 14:21
@martin-eden
Copy link

Open source is love!

I wonder who needs that feature? Lot of feature requests from end users?

What is next? Add tracking and ads to IDE?

@arduino arduino locked as resolved and limited conversation to collaborators Dec 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants