question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use proto library that provides tree-shakeable code

See original GitHub issue

Problem

ts-proto generate code that is not tree-shakeable. See https://github.com/status-im/status-web/issues/233

This is an issue as it inflate the package size for library consumers.

It also uses Buffer.

Solution

Possibly investigate using ipfs/protons or protobuf-js directly.

Definition of Done

Bonus

js-waku currently uses bufbuild and ts-proto which has several downsides:

  • bufbuild is a separate binary that has to be installed
  • ts-proto generates code that uses Buffer It also has pros:
  • Generated code is TypeScript
  • Generates from proto files

Review whether we can use the solution for the examples in js-waku too.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
D4ntecommented, Apr 1, 2022

Maintenance has been resumed 🎉 https://github.com/ipfs/protons/commit/74d3b7abf1e857f7320c100734e797855ea728c1

Focusing this issue in the tree-shakeable problem.

1reaction
prichodkocommented, Mar 2, 2022

I’ve also detected that generated files are not tree-shakeable, leaving a lot of unused code in the final bundle. See more: https://github.com/status-im/status-web/issues/233. I will investigate, whether there are some possibilities to optimize.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Make Tree Shakeable Libraries - Theodo blog
Tree shaking is a way to achieve dead code elimination by ... Most libraries will use CJS modules because it allows them to...
Read more >
Library mode output not tree-shakeable when consumed by ...
Describe the bug When writing a library using vite "library mode," the output is expected to be tree-shakeable regardless of where it is...
Read more >
How to build tree-shakeable JavaScript libraries - Cube Blog
You'll know to write JavaScript code in a tree-shakeable way and produce smaller bundles. If you're building a JavaScript library, ...
Read more >
Tree shaking - The newline Guide to Creating a React Hooks ...
Tree shaking is the process of removing unused code from your bundle. When you develop your modern web app, you usually use tools...
Read more >
Tree-Shaking Problems with Component Libraries - Medium
If you're publishing a component library, offer an ES Module build — and avoid ... Use ES2015 module syntax (i.e. import and export...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found