Skip to content

demo worker - #1418

Merged
UziTech merged 14 commits into
markedjs:masterfrom
UziTech:version-worker
Feb 17, 2019
Merged

demo worker#1418
UziTech merged 14 commits into
markedjs:masterfrom
UziTech:version-worker

Conversation

@UziTech

@UziTechUziTech commented Feb 13, 2019

Copy link
Copy Markdown
Member

Description

I added a web worker to the demo page. This will allow easier testing for redos attacks.

You can test it out at: https://docs-8bxhez41v.now.sh/demo/

This PR adds is branched off #1415 with https://github.com/remyhunt/marked/pull/1 merged so we should get that PR merged first.

Contributor

  • no tests required for this PR.

Committer

In most cases, this should be a different person than the contributor.

  • Draft GitHub release notes have been updated.
  • CI is green (no forced merge required).
  • Merge PR

@UziTech

UziTech commented Feb 13, 2019

Copy link
Copy Markdown
MemberAuthor

Check out the current redos here

This takes about 10 seconds to parse on my machine.

You can change the version to 0.4.0 and see it only takes a few ms

@UziTech

UziTech commented Feb 14, 2019

Copy link
Copy Markdown
MemberAuthor

I added the ability to add commit version so we could test PRs

image

check out the current redos with PR #1414here

You can switch between ceee178 and master to see the redos

Comment threaddocs/demo/demo.js Outdated
@UziTech

Copy link
Copy Markdown
MemberAuthor

I also got it working with PRs

image

I moved quite a bit of code around to make it more readable and added a loading screen at the beginning since we need to load the versions and worker before anything will work.

the latest version is at: https://docs-g29qo7nxq.now.sh/demo/

@styflestyfle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Amazing! 🎉

I was going to suggest we start deploying PR's using ZEIT Now but this is almost just as good, as long as we don't refactor marked into multiple files.

@UziTech

Copy link
Copy Markdown
MemberAuthor

If we refactor marked in multiple files and use ES modules it should still work in modern browsers.

@davisjamdavisjam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I've never used WebWorkers but this looks about like I would have imagined it.

Can we recycle some of this code into a marked+timeout API usable in Node and web contexts?

@joshbrucejoshbruce left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just verification for milestone considerations. This only effects the demo site at this point, not marked itself. It improves our ability to discover the one major bug type we feel rushed to fix.

@UziTech

Copy link
Copy Markdown
MemberAuthor

@joshbruce correct, this only changes the demo site

@joshbruce

Copy link
Copy Markdown
Member

Sorry didn't notice this the first time but I'd like to add the same caveat for my approval as what's on #1414 - what's up with Snyk? What needs to happen? What can I do to help that endeavor?

@UziTech

Copy link
Copy Markdown
MemberAuthor

see my comment on Snyk at #1414 (comment)

@UziTech
UziTech merged commit da67561 into markedjs:masterFeb 17, 2019
@UziTechUziTech mentioned this pull request Feb 18, 2019
12 tasks
@UziTech
UziTech deleted the version-worker branch February 19, 2019 20:18
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@UziTech@joshbruce@styfle@davisjam