josevalim
Hi everyone,
With the v1.7 release, we have received reports of some dependencies no longer working properly on the new release.
Developers should not expect breaking changes from Elixir on minor and patch releases. We outline our compatibility and deprecations policy in our docs: Compatibility and deprecations — Elixir v1.20.2
This means that, if there is something effectively broken in a new release, it is one of:
- We messed up and accidentally introduced a regression, which we have to fix
- We fixed a bug that you were accidentally relying on. It is still our bad. We will either have to accept this or find a better way to do a bug fix (for example, introduce a new function and deprecate the old one)
- Some project (it could be yours) was using private API
Thanks to everyone, we are able to catch the huge majority of the occurrences of 1 and 2 during the RCs. However, there are still many cases where developers are simply using private Elixir modules and functionality - which may be renamed or completely removed in new Elixir versions. We do not provide any guarantees for private functionality. Needless to say, DO NOT USE PRIVATE APIs.
Using private APIs generate a negative cascade effect in the community because it makes developers unable to update to the latest Elixir version.
How to help
If you are a user of a project and you notice it depends on private functionality, consider reporting a bug or submitting a pull request.
If you are a library author and you are using private APIs, don’t.
If Elixir has a functionality that you need but it is private, please open up a feature request to make the desired functionality public.
Also, consider running your CI builds against Elixir master. It is as easy as:
- wget https://repo.hex.pm/builds/elixir/master.zip
- unzip -d elixir master.zip
- export PATH=$(pwd)/elixir/bin:${PATH}
Here is more info on available precompiled Elixir versions, branches and tags: GitHub - hexpm/bob: The Builder · GitHub
While I wrote this thinking about Elixir, it likely applies to most libraries out there.
Trending in Notices
Other Trending Topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 10- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
bbense
It might be nice to give people a reminder about the @moduledoc false convention. Or even better a tool that flags uses of private apis from the standard lib as a compile time warning.
josevalim
Good point @bbense! We talk about
@moduledoc falsein our documentation too: https://hexdocs.pm/elixir/master/writing-documentation.html#hiding-internal-modules-and-functionskelvinst
Also, it would really be nice to have at least a warning when a private API is being used by a module outside its application. I remember that being discussed somewhere else but don’t remember the outcome of it, maybe that’s not even possible, IDK.
CptnKirk
Wouldn’t it be better to be able to have truly private APIs built into the language so that compilation against “private” modules and functions would fail? Seems like something the language owners could add.
Something like a
defpmodulemacro that accepted either as part of the module def or possibly a well known constant, a list of module friends able to access internally public functions.josevalim
Yes, that would be the best approach, although it is not trivial to implement because of how modules are dynamic. Unless we take some liberties, such as, private modules always need to be required before using or something of sorts. Somebody would have to write such proposal. We should do it in another thread though.
tmbb
Maybe, if you want to catch things like
String.Tokenizer.tokenize(list). But if you’re happy with only detecting modules that are imported/used/required/aliased, then it’s pretty easy:The example above shows only how to deal with imported modules, but the idea might work for other kinds of modules. There are probably some subtleties I’m not capturing here, of course…
mgwidmann
I would say some of the issue stems from the fact that its not easy to be able to identify if a module is intended for public consumption or not. The elixir language is well documented and that makes it clearer, but it doesn’t make it black and white. How should one tell the difference between “maybe its missing documentation” and a module which is intended to be private?
Theres a larger issue to solve here, as has been mentioned. However, to address the problem at hand in the moment perhaps all internal modules should be marked as such.
String.Internal.Tokenizerwould make it plainly clear.hpopp
Shouldn’t
@moduledoc falsejust become the default behavior for undocumented modules? I’ve always wondered why documentation has been considered opt-out inex_docjosevalim
For the Elixir language itself it should be black and white. Elixir categorically marks all private functionality with
@moduledoc falseand@doc false. Those do not appear on the official documentation, which means their usage is being lifted directly from the source code.To clarify, this has never been an issue in Elixir itself. Or we explicitly document it or we tag it as false. Sure, there are projects in the community where this issue will arise but it is definitely not the source of confusion in this case.
Eiji
@josevalim: Please take a look at @lexmag response:
It was written in almost 2 years ago and still
ExUnit.Diffhas no public API. It would be helpful if you will be able to change it.