GithubHelp home page GithubHelp logo

Comments (3)

timostamm avatar timostamm commented on June 26, 2024

Hey Cyril, I think you're right that the call to newFieldList in generated TS can impact tree-shaking:

static readonly fields: FieldList = proto3.util.newFieldList(() => [

I believe that adding a /*@__PURE__*/ annotation right before the call expression should help (see #470 for reference).

But before we make this change, we need to verify that it actually works as expected (previous changes were tested with https://github.com/connectrpc/examples-es/tree/main/bundle-size). This will take us a bit to look into, but it looks worthwhile to me.

Thanks for filing the issue!

from protobuf-es.

smaye81 avatar smaye81 commented on June 26, 2024

Hi @liril-net. We tested adding this annotation to the newFieldList call, but we aren't seeing any effect with Rollup (or most other bundlers). The only bundler that sees an improvement is esbuild. The PR we're using to test is here.

Are you noticing anything different with Rollup? Or do you see anything missing from how we are bundling in our tests?

from protobuf-es.

timostamm avatar timostamm commented on June 26, 2024

Let's close this. See connectrpc/examples-es#1499 (comment) for details.

from protobuf-es.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.