Skip to content

Conversation

kraynel
Copy link
Contributor

@kraynel kraynel commented Jan 27, 2020

Package size is currently 317kb.

The generated mappingTable.json alone is 253kb.

In this PR I optimize this file to be around 130kb (51% the original size):

  • Use mappings to avoid using the same strings over and over
  • Keep only the first bound of the range when mapping is for 1 charcode
  • For valid charcodes, drop last 2 columns (not used)

I guess we could go a lot further. One way of drastically reducing the package size would be to build the mapping table during the postInstall phase and not package them.

@kraynel kraynel force-pushed the decrease-package-size branch from 7de635b to f5efc93 Compare January 27, 2020 09:01
@kraynel kraynel force-pushed the decrease-package-size branch from f5efc93 to 3a70a12 Compare January 27, 2020 11:06
@kraynel kraynel requested a review from TimothyGu February 10, 2020 13:34
index.js Outdated

if (min <= val && max >= val) {
if (target[1] === STATUS_MAPPING.disallowed_STD3_valid || target[1] === STATUS_MAPPING.disallowed_STD3_mapped) {
let newStatus = "";
Copy link
Member

Choose a reason for hiding this comment

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

This should probably not be initialized here, as the code block below initializes it to a number.

@TimothyGu TimothyGu merged commit cd25663 into jsdom:master Feb 20, 2020
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.

2 participants