Skip to content

[$500] ExpensiMark: large bundle size #31183

Closed

Description

@tomekzaw

Problem
A simple script that uses ExpensiMark library to parse Markdown into HTML has a bundle size of 336 kB (or 184 kB minified) which is quite big.

Details
The file is large because it contains mappings of all HTML entities (from _.escape) and countries, states, currencies etc. from CONST.jsx.

Solution
Investigate if it's possible to minimize the bundle size.

Steps to reproduce

index.js

import ExpensiMark from "expensify-common/lib/ExpensiMark";

const input = "Hello, *world*!";
const parser = new ExpensiMark();
const output = parser.replace(input);

console.log(JSON.stringify(input));
console.log(JSON.stringify(output));
esbuild index.js --bundle --minify --outfile=out.js

out.js: https://pastebin.swmansion.com/?9798f33833cc33b6#DRgiwxs8ujteamHaGDioSzZVZ83nuWUim3QabJ5PUYed

Issue OwnerCurrent Issue Owner: @Skalakid
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~0155a63860a646579c
  • Upwork Job ID: 1740457868647858176
  • Last Price Increase: 2024-01-04
  • Automatic offers:
    • fedirjh | Reviewer | 28090032
    • aswin-s | Contributor | 28099676

Activity

  1. self-assigned this
    on Nov 10, 2023
  2. added
    NewFeature
    on Nov 10, 2023
  3. melvin-bot commented on Nov 10, 2023

    @melvin-bot
  4. added
    Weekly
    and removed on Nov 10, 2023
  5. roryabraham commented on Nov 10, 2023

    @roryabraham
    Contributor

    Co-assigning myself to supervise, but this will be worked on by Michał Skałka from SWM, who will be invoicing us separately

  6. roryabraham commented on Nov 10, 2023

    @roryabraham
    Contributor

    Maybe the first and easiest steps here are to:

    1. Port Expensimark to typescript and stop using underscore – that would likely help reduce the file size
    2. Split up the big CONST export and separately export/import only the pieces that we need in Expensimark
  7. Skalakid commented on Nov 10, 2023

    @Skalakid
    Contributor

    Hi I’m Michał from Software Mansion, an expert agency, and I’d like to work on this issue

  8. 53 remaining items

  9. aswin-s commented on Jan 24, 2024

    @aswin-s
    Contributor

    PR was merged on Jan 15th. This one is ready for payment.

  10. abekkala commented on Jan 24, 2024

    @abekkala
    Contributor

    @roryabraham I want to make sure I'm looking at the Correct PR.
    The one above has not merged to production yet, correct?
    The payment countdown starts after it's merged to production and there are no regressions.

    @aswin-s The PR above Expensify/expensify-common#632 is not showing merged to prod yet.

    once that happens the payment title for this GH will auto-update with the payment date

  11. aswin-s commented on Jan 26, 2024

    @aswin-s
    Contributor

    @abekkala PR is merged to master in expensify-common repository. Melvin seems to be tracking PRs from Expensify/App repository only.

    @roryabraham Could you please confirm?

  12. roryabraham commented on Jan 26, 2024

    @roryabraham
    Contributor

    Ah, sorry for the confusion here. @aswin-s can you please open an E/App PR to upgrade the expensify-common version we're using (otherwise the PR won't take effect). Then once that hit production we can issue payment.

  13. added
    Reviewing
    Weekly
    and removed
    Weekly
    on Jan 28, 2024
  14. fedirjh commented on Jan 30, 2024

    @fedirjh
    Contributor

    This PR got superseded by #34801. Expensify-commons has got upgraded to a more recent commit than the one mentioned in this PR.

    It seems that expensify-common was upgraded in #34801.

  15. aswin-s commented on Feb 7, 2024

    @aswin-s
    Contributor

    Ah, sorry for the confusion here. @aswin-s can you please open an E/App PR to upgrade the expensify-common version we're using (otherwise the PR won't take effect). Then once that hit production we can issue payment.

    @abekkala @roryabraham Above PR has already hit PROD last week.

  16. roryabraham commented on Feb 7, 2024

    @roryabraham
    Contributor

    @abekkala can we please issue payment of $500 to @aswin-s for Expensify/expensify-common#632 ?

  17. abekkala commented on Feb 8, 2024

    @abekkala
    Contributor

    @roryabraham yes, I can send an upwork offer to @aswin-s
    Was there someone who did the PR review (that needs payment as well)? or was that done internally?

  18. roryabraham commented on Feb 17, 2024

    @roryabraham
    Contributor

    PRs for this issue were reviewed internally

  19. abekkala commented on Feb 19, 2024

    @abekkala
    Contributor

    @aswin-s payment sent and contract ended - thank you!

  20. moved this from Todo to Done in Live Markdownon Mar 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

EngineeringExternalNewFeatureReviewingWeekly

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions