Coder Social home page Coder Social logo

Comments (3)

bradzacher avatar bradzacher commented on May 3, 2024

yeah I noticed the same thing with some other formatters - dprint-plugin-exec essentially runs "for each file, read file from disk, pass to exec formatter, read format result from output"

This ofc means that you pay the spin up / spin down cost for the executable - which is BRUTAL.

If we could do something like "pipe/pass list of files and expect a JSON response" then it would be much more efficient in every way.

from dprint-plugin-exec.

dsherret avatar dsherret commented on May 3, 2024

I'd recommend ensuring that incremental formatting is not disabled (don't have "incremental": false in the config file). It will be slower on the first run than dprint-plugin-rustfmt was, but after that it will only format files that have changed, which should be almost as fast as before. On the CI, there is a way to cache the incremental cache to also make it fast. Unfortunately there is a bug related to caching on GH actions (dprint/dprint#735) so after I fix that I will update and add some instructions here: https://dprint.dev/ci/

Unfortunately I have too many projects and so I had to cut back somehow. dprint-plugin-rustfmt was dropped because dealing with its upgrades became difficult and a drawback with using it was that running cargo fmt could differ whereas now with dprint-plugin-exec the two can be more easily aligned.

If we could do something like "pipe/pass list of files and expect a JSON response" then it would be much more efficient in every way.

The issue is that it needs to also work in an editor scenario where the file might not exist on the file system. Additionally, adding this introduces complexity both for dprint's plugin system and for users configuring the exec plugin because they'd have to provide a way to get executables to work with file paths and when formatting via stdin.

This ofc means that you pay the spin up / spin down cost for the executable - which is BRUTAL.

Yeah, this is why dprint-plugin-prettier and dprint-plugin-roslyn still exist. Languages like JS and C# (when not using AOT compilation) are too slow to startup, but rustfmt is fast enough.

from dprint-plugin-exec.

aminya avatar aminya commented on May 3, 2024

I think archiving the repository and blocking any contribution is not the solution to the maintainace burden. Even if someone is interested in helping you, they cannot make a pull request.

https://github.com/dprint/dprint-plugin-rustfmt

Now, dprint is moving against the very reason I was using it: Fast formatting and built-in integration. I also do not understand this requirement that everything should run inside WASM. Why is that a requirement, and why is it worth damaging the ecosystem because of WASM?

from dprint-plugin-exec.

Related Issues (13)

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.