CargoSense / dart_sass

Install and run Dart Sass using Elixir.
https://hex.pm/packages/dart_sass
MIT License
102 stars 23 forks source link

Option to remove version check #32

Closed hissssst closed 1 year ago

hissssst commented 1 year ago

I don't know why version check exists in the first place, but I don't think that software should check versions of it's dependencies in runtime, that's a job for package managers.

It would be nice to have something like version: false handled.

mcrumm commented 1 year ago

You have to specify the version so dart_sass knows which version to download. :)

We could maybe support this with another config key, something like validate_version, but I am not sure. What problem are we trying to avoid by removing the version check?

hissssst commented 1 year ago

@mcrumm , I am using my package manager to install the sass, and I don't want to perform any version checks or download the sass.

Problem is that some sass executables provide additional information like

$ sass --version
1.2.3 compiled with dart2js v4.5.6 (commit 0xdeadbeef)

And there are two ways to overcome this problem:

  1. Specify exactly the same version returned by sass executable.

    if sass = System.get_env("MIX_SASS_PATH") do
    {sass_version, 0} = System.cmd(sass, ["--version"])
    
    config :dart_sass,
    version: sass_version,
    path: sass,
    default: [
      ...
    ]
    end

    What is clearly a hack

  2. Fix the version checking mechanism in dart_sass library, which is impossible to do correctly, since format may change from build to build.

So, while thinking outside the box, the version checking mechanism is just not necessary, as it is not necessary to automatically download the at compile time.

I would suggest just

  1. Removing the version check and automatic download
  2. Leaving dependency management to the package manager, or at least moving the download to Mix task
hissssst commented 1 year ago

@mcrumm thanks! :heart: :blue_heart: :purple_heart: