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

Blocks: Upgrade simple-html-tokenizer dependency #15246

Merged
merged 1 commit into from
Apr 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"lodash": "^4.17.11",
"rememo": "^3.0.0",
"showdown": "^1.8.6",
"simple-html-tokenizer": "^0.4.1",
"simple-html-tokenizer": "^0.5.7",
"tinycolor2": "^1.4.1",
"uuid": "^3.3.2"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/blocks/src/api/validation.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import Tokenizer from 'simple-html-tokenizer/dist/es6/tokenizer';
Copy link
Member

Choose a reason for hiding this comment

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

I'm guessing by your measure of the size difference, it has not regressed (possibly because of better ES module support than they had previously†), but the reason it was originally written this way was to avoid the side effect of importing the very very large character reference set.

https://github.com/tildeio/simple-html-tokenizer/blob/9a894bd75545e107638272f3e1e812933815953f/src/index.ts#L2-L4

https://github.com/tildeio/simple-html-tokenizer/blob/master/src/generated/html5-named-char-refs.ts

† I'd forgot I made this pull request: tildeio/simple-html-tokenizer#49 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

It would explain why it works so well now 😍

import { Tokenizer } from 'simple-html-tokenizer';
import {
identity,
xor,
Expand Down
3 changes: 0 additions & 3 deletions test/unit/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,4 @@ module.exports = {
'<rootDir>/.*/build/',
'<rootDir>/.*/build-module/',
],
transformIgnorePatterns: [
'node_modules/(?!(simple-html-tokenizer)/)',
],
};