Live data from Hacker News

Show HN: Affinity.js – A simple view component library with store

news.ycombinator.com

11–13 of 13 posts

Re: Show HN: Affinity.js – A simple view component library with store

#12

Feedback: 1. Parser prohibits literal "@click", there is no escape mechanism. 2. Only click, what about other DOM events? 3. Leaking: Event listeners not removed in destructor (your clean() function?) 4. No XSS protection, ow. 5. No tests, might want some. 6. Based on innerHTML assignment with nothing to guarantee valid HTML. 7. No error handling.

added a more robust and better event listeners handling - which prevent leaking completely.

Re: Show HN: Affinity.js – A simple view component library with store

#13
post #7

Feedback: 1. Parser prohibits literal "@click", there is no escape mechanism. 2. Only click, what about other DOM events? 3. Leaking: Event listeners not removed in destructor (your clean() function?) 4. No XSS protection, ow. 5. No tests, might want some. 6. Based on innerHTML assignment with nothing to guarantee valid HTML. 7. No error handling.

1. '@click' is replaced with a valid 'data-af-click' attribubte. 2. click was a poc - all events are added. 3. 'clean' is using "node.remove" ad removes any references to functions - so - no detached references are left then. 4. correct - not taken into consideration at the moment. 5. agree. 6. innerHTML is a valid assignment - the browser validates it. 7. to be discussed

This is probably obvious, but just in case : for point 4 this is DOM-based XSS protection that is missing.
Post reply on HN