-
-
Notifications
You must be signed in to change notification settings - Fork 735
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 library to support ES201* JavaScript #206
Conversation
Heya, is this already ready for merging? |
No no. I was more waiting for some input. Agreement and potentially disagreements. I can continue working on it as soon as I have time whenever the general path is agreed with kina |
3a7bb77
to
697e001
Compare
@cure53 Alright, progress. The build passes again and all tooling, apart from the webpack vs. rollup debate, is in place. Next up I will have to rebase/merge with master. Which is gonna be a bit of hand picking 🐱 . |
Sorry, I honestly have no idea about these things and rely on review-input from @fhemberger and @neilj :) My feedback here is as worthless as it can be. |
7bac0cf
to
e65bd2b
Compare
No worries. I just rebased all changes over |
b6a1e72
to
00bfb8a
Compare
Alright, rebased again on top of |
@tdeekens Sorry, I haven't worked with webpack or rollup so far, so I can't asses this PR. |
No worries. I'll have a friend very familiar with it look over it maybe to give some "trust indication"? |
...so karma now also runs using rollup and some other improvements have been made. |
I finally managed to read the code, shall we give it a try? :D Or not yet merge ready? |
Nothing much to add from my side. Give me the weekend to look over things one last time and maybe update our jsdom testing to jsdom@10. I'll ping you once I am certain all is good. 🎈 |
@cure53. From my side this is ready to go in. Anything you'd like addressed before hitting the button? Maybe you can run the branch against the whole browser suite before getting it merged as we don't test cross browser on PRs? |
I took a look at this as requested by @tdeekens and ran the cross-browser test-suite against the configured browsers as well as the most recent versions of Firefox, Chrome, Safari and Edge. The tests are fine except for IE Edge 15, where this test seems to be consistently failing: https://github.com/tdeekens/DOMPurify/blob/refactoring/es2016/test/test-suite.js#L36 Output
But if I read the comment next to the test correctly, that seems to be expected. So don't know if there is any issue here. Besides that I only found two minor issues:
Wasn't in the mood to create a PR for things that small .. sorry 😉 Apart from that the setup looks fine to me and the application code at least looks sane. Cannot comment on functionality per se, but the tests are passing so we should be fine. I would have one suggestion for improvement, which would be to also run the test-suite in mobile browsers as that is a feasible use-case for the library and possible with Browserstack. But I do not know if you want to support that. |
Thanks bud. I'll take care of the two minor issues. The failing test is something @cure53 should comment on. |
The last two commits address the issues mentioned. Leaves us with:
Thanks everyone! |
Good catch, fixed it :D |
Did you fix the yosemite typo only - as I did here too - or also the failing test? 😅 |
Only fixed the typo so far.
This looks safe to me. MSIE/Edge often change attribute orders. This can be added to the expectations array without risk as far as I can see. |
Do you mind adding it? I'll then resolve conflicts here and we can get this in? |
Done :) |
b908d9f
to
c33daff
Compare
Alright @cure53 clean rebase, clean merge? Merge whenever you feel like it. |
@tdeekens Looks like the browser tests are failing now, maybe I did sth wrong? |
Oh shot. I will look into it. I ran karma locally before and thought we ran againat BrowserStack too. Can only be some configuration. |
I just ran the karma tests locally and they pass. I also ran FF52 and IE10 against my personal BrowserStack account and they pass. I am bit confused by why the failed after the merge. The error indicates that our setup is not transpiled correctly. I'll try to find out why. |
Yeah looks like it, thx :) |
Background & Context
Currently DOMPurity does not have a built tool in place. This is nice and often simplifies things. However, adding webpack might give the project some benefits and this issue is about to align on the potential gain of it.
This PR might change quite a couple of things and can/should be seen as a start of a discussion on how far to go with things.
import sanitize, { addHook } from 'purify'
Included in this
Open complications
I tried to split up changes into sensible commits to be "easier" to digest. I hope it worked.
closes #202