Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@fb55
Copy link
Collaborator

@fb55 fb55 commented Apr 20, 2022

This has to be done as a PR due to branch protection.

This has to be done as a PR due to branch protection.
@fb55 fb55 requested review from 43081j and wooorm April 20, 2022 09:56
Copy link
Collaborator

@wooorm wooorm left a comment

Choose a reason for hiding this comment

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

Exciting! 👍

Do you know how you’re about to publish?

@fb55
Copy link
Collaborator Author

fb55 commented Apr 20, 2022

Do you know how you’re about to publish?

I only know about npm publish --workspaces. Any tricks you can share on top of that?

@fb55 fb55 merged commit abec4c2 into master Apr 20, 2022
@fb55 fb55 deleted the 7.0.0 branch April 20, 2022 10:55
@wooorm
Copy link
Collaborator

wooorm commented Apr 20, 2022

Yeah 👍 Also, you might want to tag the commit, if you can. They use a v prefix here: https://github.com/inikulin/parse5/releases. Have you thought about a release changelog entry?

@fb55
Copy link
Collaborator Author

fb55 commented Apr 20, 2022

Published all packages. I had to manually remove some files before publishing, as I couldn't get ignore patterns to properly work before publishing (see #510).

Release notes are at https://github.com/inikulin/parse5/releases/tag/v7.0.0. Please let me know if there is anything you'd like to change!

@wooorm
Copy link
Collaborator

wooorm commented Apr 20, 2022

That’s a lot! What I like about it, is that all the information that people need, is there. I do think it can be restructured and improved somewhat.

  • Things like 1.45x are hard to understand. is that 45% faster? More than twice as fast?
  • There is too much emphasis: there are many links, many numbers, whole strong sentences. When everything is marked up as important, nothing is important anymore. This can be solved by improving the structure of the entry, I believe

Let me try and see if I can reword it, I’ll post it here.

P.S. Lastly, personally, I believe I’ve expressed this before but I want to stress it, I find the docs very bad. There are only types (and some barely readable prose extracted from them, and out-of-date examples). I think it’s important to prioritize how a newcomer goes from seeing this repo to using the project.

@fb55
Copy link
Collaborator Author

fb55 commented Apr 20, 2022

Things like 1.45x are hard to understand. is that 45% faster? More than twice as fast?

This is this ratio:

console.log(`Working copy is ${(workingCopyHz / upstreamHz).toFixed(2)}x faster.\n`);

There is too much emphasis

I see your point. I tried working around this via headings, but there definitely is room for improvement. Curious to see where you end up!

I find the docs very bad

I agree with this. The only reason I pushed for TypeDoc is that manually managing Markdown files generated by TypeDoc is strictly inferior to managing source code, which then use TypeDoc to generate documentation (because information is otherwise duplicated, colocation makes a need for updates more evident etc.).

For me, the main thing I'd like to see in terms of documentation are some guides, which explain how to use each of the packages in this repo. Do you have something you'd prioritise instead?

@wooorm
Copy link
Collaborator

wooorm commented Apr 20, 2022

How about this? This is what I’d go with. But you know much more about this project than I so I might be missing or misrepresenting important things.

In particular, I have two inline questions for the last two Potentially breaking changes points.

Also: this displays here differently that in the release (notably heading size). Please preview there to see how it will end up exactly!

Welcome to `parse5@7`! ✨ This is a big release with many improvements but also some breaking changes.

`parse5` is now maintained by the community (more who’s who below). **We need your support to maintain `parse5`!** You can help us out financially on [OpenCollective](https://opencollective.com/parse5) or help out on the issues.

#### In short

* ESM
* TypeScript
* HTML spec updates
* Performance improvements (±50-150% faster)

#### Breaking: ESM

The packages are now ESM. We’ve shipped dual packages for `parse5` and `parse5-htmlparser2-tree-adapter` for now though. To migrate, please read [this Gist](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c) on how to update.
Note that private internals are no longer available.

*Implemented by @43081j in #351*

#### Breaking: TypeScript

The codebase is now in TypeScript, which uncovered many bugs, and resulted in much improved types. To migrate, please remove `@types/parse5*` as we now ship our own types.

*Implemented by @fb55 in #362*

#### Potentially breaking changes

* Update to match changes in HTML spec (#442, #451)
* Remove `parse5-serializer-stream` (**to do: how to migrate**) (#481)
* ?? The rewriting stream now splits very long text sections (#434) and doesn’t escape text in special tags anymore (#434) (**to do: what does this mean and how to migrate**)
* ?? The htmlparser2 adapter now uses `domhandler`’s node interface (#327) (**to do: how is this breaking? how to migrate**)

#### Other changes

* **minor** add hooks for stack events to tree adapter interface #385
* **minor** add support for fragments in `parse5-parser-stream` #487
* **minor** add `serializeOuter` (like `.outerHTML`), `scriptingEnabled` option #383
* **patch** fix parsing of `<<` in comments parsed wrongly as `<!` (#326)
* **patch** fix position of `endTag` for mixed-case foreign elements (#353)
* **patch** fix position of `html`, `body` in edge cases (#436)
* docs: parse5 has a new documentation website at [`parse5.js.org`](http://parse5.js.org/) #443

We’ve also changed the hidden internals. You probably don’t use those. But if you’re wondering:

<details><summary>Show internal changes</summary>

* Use state machine pattern from htmlparser2 in tokenizer [`5d7a780` (#362)](https://github.com/inikulin/parse5/pull/362/commits/5d7a780b70d3669def4c6bb20cbec816804d44a5)
* Replace token queue with callbacks (#404, #405, #419)
* Use callbacks in `OpenElementStack` #429
* Remove mixins (as part of #362)
* Remove `getNextToken` #461
* Remove `_bootstrap` parse method #384
* Drop chunks from the tokenizer right when they are emitted #432
* Change from class in serializer #383
* Use [`entities`](https://github.com/fb55/entities) module for encoding and decoding entities ([`2b92054` (#362)](https://github.com/inikulin/parse5/pull/362/commits/2b9205458b9305de1406966568567ccfc1633fa1), #486) 

</details>

#### Community

As mentioned before, the community now maintains `parse5` (come and help if you can!) The main people for this release were James (@43081j), Titus (@wooorm) and me (@fb55). We come from three projects that rely on parse5 being maintained, modern, and matching HTML (namely [Cheerio](https://github.com/cheeriojs/cheerio), [rehype](https://github.com/rehypejs/rehype), and [Lit](https://lit.dev/)).
**We need your support to maintain `parse5`!** If you care about `parse5`, help us out financially on [OpenCollective](https://opencollective.com/parse5)!

#### New contributors

Thanks @anko, @TrySound, @samouri, @alan-agius4, @pmdartus!

**Full changelog**: https://github.com/inikulin/parse5/compare/v6.0.1...v7.0.0

@wooorm
Copy link
Collaborator

wooorm commented Apr 20, 2022

(note: I forgot the community bit at the bottom first)

@fb55
Copy link
Collaborator Author

fb55 commented Apr 20, 2022

Great rewrite — I've adopted most of the changes.

jmbpwtw pushed a commit to jmbpwtw/parse5 that referenced this pull request Feb 16, 2023
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.

3 participants