-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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: v2 release #6903
base: main
Are you sure you want to change the base?
refactor: v2 release #6903
Conversation
🦋 Changeset detectedLatest commit: a6ea466 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
built with Refined Cloudflare Pages Action⚡ Cloudflare Pages Deployment
|
} | ||
errorDiv.setAttribute('q:key', '_error_'); | ||
const journal: VNodeJournal = []; | ||
vnode_getDOMChildNodes(journal, vHost).forEach((child) => errorDiv.appendChild(child)); |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
DOM text
DOM text
DOM text
DOM text
DOM text
} else if (key === 'value' && key in element) { | ||
(element as any).value = escapeHTML(String(value)); | ||
} else if (key === dangerouslySetInnerHTML) { | ||
(element as any).innerHTML = value!; |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
DOM text
DOM text
DOM text
DOM text
DOM text
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 4 days ago
To fix the problem, we need to ensure that any HTML content assigned to innerHTML
is properly sanitized to prevent XSS attacks. This can be achieved by using a library like DOMPurify
to sanitize the HTML content before assigning it to innerHTML
.
- Import the
DOMPurify
library. - Use
DOMPurify.sanitize
to sanitize thevalue
before assigning it toinnerHTML
. - Ensure that the
DOMPurify
library is included in the project dependencies.
-
Copy modified line R1 -
Copy modified line R896
@@ -1,4 +1,4 @@ | ||
import DOMPurify from 'dompurify'; | ||
/** | ||
* @file | ||
* | ||
* VNode is a DOM like API for walking the DOM but it: | ||
@@ -895,3 +895,3 @@ | ||
} else if (key === dangerouslySetInnerHTML) { | ||
(element as any).innerHTML = value!; | ||
(element as any).innerHTML = DOMPurify.sanitize(value!); | ||
} else { |
-
Copy modified lines R11-R12
@@ -10,3 +10,4 @@ | ||
"dependencies": { | ||
"csstype": "^3.1" | ||
"csstype": "^3.1", | ||
"dompurify": "^3.2.4" | ||
}, |
Package | Version | Security advisories |
dompurify (npm) | 3.2.4 | None |
const insertBefore = journal[idx++] as Element | Text | null; | ||
let newChild: any; | ||
while (idx < length && typeof (newChild = journal[idx]) !== 'number') { | ||
insertParent.insertBefore(newChild, insertBefore); |
Check warning
Code scanning / CodeQL
DOM text reinterpreted as HTML Medium
DOM text
DOM text
DOM text
DOM text
DOM text
DOM text
`flags`, `varProps` and `constProps` This assures compatibility with v1 types
they are not necessary and they make the API harder to grasp
chore: make v2 types v1 compatible
fix: component as function call
fix(v2): fix component type
V2 Version Packages (alpha)
get it from a different qrl instead
also refactor
refactor(core): schedule QRLs instead of direct execution
Co-authored-by: wuls <[email protected]>
this provides a better hint it's done by Qwik ⚡
fix: build and codeql
fix(repl): properly resolve handlers.mjs
Co-authored-by: wuls <[email protected]>
Co-authored-by: Wout Mertens <[email protected]>
fix(perf): use sets instead of arrays for effects
This PR is for showing progress on v2, and having installable npm packages.
DO NOT MERGE
The changes are meant to be readable and maintainable, so if things are unclear please let us know.