How to contribute to native modules in elm package

In ver 0.19, native modules are not allowed except in elm/ or elm-explorer/.
I found a chance to contribute to native modules in elm package. However, because of this restriction, I can’t debug with native modules and contribute to this package.

Is there a special way to do this? Or, I’m not allowed this contributing?

1 Like

Which package is it? You can make pull requests against the packages under elm/ and elm-explorations/ on GitHub same as anything else on there. It also seems that the best way to have success with this is to approach the project maintainer and talk your proposed changes through with them - Evan in most cases, but some of these projects do have other maintainers.

Testing the changes is not so easy with the native restrictions.

1 Like

I haven’t had to do this in a while, but I think this approach still works for testing out changes to a package with native code:

  • in your terminal, set ELM_HOME to some new directory (this will make the stuff that’s normally put into ~/.elm be put in the specified folder instead)
  • then you can make the changes you want to test in $ELM_HOME/0.19.0/package/[package name you are modifying]/[latest package version]/src
  • then if you compile your test app or tests with ELM_HOME set, it will use your changed version of the package
6 Likes

I’m thinking about elm/bytes.

I know that talking with a project maintainer is needed to contribute to an Elm package.
So, I will try to describe my approach!

I’m relieved to hear that allowed to make pull request.

I didn’t know ELM_HOME.

This way is available in my environment too.
I will try to test my code in this way. Thank you!

1 Like

In a similar vein, you can symlink in a directory to ~/.elm/0.19.0/<package>/<version>/.

I think you also have to delete the .dat files generated in that directory after each build and remove the elm-stuff directory in your project to see the changes show up.

2 Likes

You might find some insight in the test script for elm/core. Although that might be overkill for other elm/* packages which aren’t treated specially by the compiler.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.