The Wayback Machine - https://web.archive.org/web/20220510230156/https://github.com/posthtml/posthtml/issues/275
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

Interested in collaboration #275

Open
jonathantneal opened this issue Jan 17, 2019 · 5 comments
Open

Interested in collaboration #275

jonathantneal opened this issue Jan 17, 2019 · 5 comments

Comments

@jonathantneal
Copy link

@jonathantneal jonathantneal commented Jan 17, 2019

I haven’t been able to figure out how to communicate how valuable I find PostHTML to be and how much I would like to see it get some additional features. As a big fan of PostCSS, I’ve been writing my own version of PostHTML that borrows a lot of the same concepts and brings them to PostHTML.

https://jonathantneal.github.io/posthtml/

The API is nearly fully documented, though I haven’t yet added the tokenizer for classList’ing any attribute (see https://briankardell.wordpress.com/2016/03/29/tokenlists-missing-web-dna/)

I’d love to see these features make their way into an existing library. I’m working on writing the most common Webpack, Express, Grunt, and Gulp bindings, as well as CLI tooling and a handful of common plugins necessary to make it worthwhile.

If you are interested; could you let me know how I could help wire up PRs, or which features you might take issue with?

Feel free to delete this if you are not interested. I’m sorry to bother you. I know my proposal is being pitched in a really weird way.

@Scrum
Copy link

@Scrum Scrum commented Jan 18, 2019

@jonathantneal Hi, Thank you for your interest, it is very important for us and we welcome any suggestions and are ready for action.

I’d love to see these features make their way into an existing library. I’m working on writing the most common Webpack, Express, Grunt, and Gulp bindings, as well as CLI tooling and a handful of common plugins necessary to make it worthwhile.

How would you be more comfortable to do this? and how can we help you?

If you are interested; could you let me know how I could help wire up PRs, or which features you might take issue with?

Upcoming planned work on the expansion of the api and the core can be found here.

@voischev
Copy link

@voischev voischev commented Jan 18, 2019

👋 LGTM

not bad to see:

  • tests
  • default plugin example
  • pref benchmark

support: Multiple matchers and Directives

@Scrum Scrum pinned this issue Jan 18, 2019
@voischev
Copy link

@voischev voischev commented Jan 18, 2019

support in Parcel

@jonathantneal
Copy link
Author

@jonathantneal jonathantneal commented Jan 18, 2019

Oh this is wonderful; thanks for the warm response. I’ll get to work on performance benchmarks, as well as a default plugin example along with some real-world plugins.

I’ve been running all of my tests out of https://github.com/jonathantneal/posthtml/blob/master/.tape.mjs, but I also think it would be better to write tests alongside the code itself, like Result.test.js.

Thanks for sharing the milestones. It looks like my changes thus far could help with #221, #242, and #243.

I’m not sure of the request in #233 , but maybe it will be helpful to have what I’ve written for traversing and modifying attributes, as well as the support for duplicate attributes and attribute ordering (also useful for linting). As I said in my last post, I also want to add token list support so you can do things like element.attributes.get('class').add('intro') or element.attributes.get('aria-describedby') add('foo-help-text').

@jonathantneal
Copy link
Author

@jonathantneal jonathantneal commented Jan 18, 2019

Here are some initial testing results:

Reshape:
  8378 operations per second
     5 cycles performed
  5.87 seconds elapsed

PostHTML (my fork):
 14019 operations per second
     4 cycles performed
 6.013 seconds elapsed

PostHTML (official):
126622 operations per second
     4 cycles performed
 5.957 seconds elapsed

I am using parse5 and I may be using the sax variation, while this project uses htmlparser2, which has the following stats:

gumbo-parser   : 34.9208 ms/file ± 21.4238
html-parser    : 24.8224 ms/file ± 15.8703
html5          : 419.597 ms/file ± 264.265
htmlparser     : 60.0722 ms/file ± 384.844
htmlparser2-dom: 12.0749 ms/file ± 6.49474
htmlparser2    : 7.49130 ms/file ± 5.74368
hubbub         : 30.4980 ms/file ± 16.4682
libxmljs       : 14.1338 ms/file ± 18.6541
parse5         : 22.0439 ms/file ± 15.3743
sax            : 49.6513 ms/file ± 26.6032

I will see if I too can switch to htmlparser2, as I can no longer remember why I chose parse5 to begin with. I think it was because I was pulling in ideas from reshape.

@Scrum Scrum unpinned this issue Jul 16, 2019
@Scrum Scrum pinned this issue Aug 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants