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

demo worker #1418

Merged
merged 14 commits into from
Feb 17, 2019
Merged

demo worker #1418

merged 14 commits into from
Feb 17, 2019

Conversation

UziTech
Copy link
Member

@UziTech UziTech commented Feb 13, 2019

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
Copy link
Member Author

UziTech commented Feb 13, 2019

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
Copy link
Member Author

UziTech commented Feb 14, 2019

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

image

check out the current redos with PR #1414 here

You can switch between ceee178 and master to see the redos

docs/demo/demo.js Outdated Show resolved Hide resolved
@UziTech
Copy link
Member Author

UziTech commented Feb 14, 2019

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/

Copy link
Member

@styfle styfle left a comment

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
Member Author

UziTech commented Feb 14, 2019

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

Copy link
Contributor

@davisjam davisjam left a comment

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?

Copy link
Member

@joshbruce joshbruce left a comment

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
Member Author

UziTech commented Feb 14, 2019

@joshbruce correct, this only changes the demo site

@joshbruce
Copy link
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
Member Author

UziTech commented Feb 16, 2019

see my comment on Snyk at #1414 (comment)

@UziTech UziTech merged commit da67561 into markedjs:master Feb 17, 2019
@UziTech UziTech mentioned this pull request Feb 18, 2019
12 tasks
@UziTech UziTech deleted the version-worker branch February 19, 2019 20:18
Sign up for free to 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