{"id":22842665,"url":"https://github.com/thecodeboss/ex_compatible","last_synced_at":"2025-03-31T05:09:43.351Z","repository":{"id":57500065,"uuid":"125670633","full_name":"thecodeboss/ex_compatible","owner":"thecodeboss","description":"ExCompatible strives to make your Elixir code compatible with as many Elixir versions as possible, while reducing the number of compiler warnings.","archived":false,"fork":false,"pushed_at":"2018-03-19T22:20:24.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-07T10:38:43.504Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thecodeboss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-03-17T21:32:43.000Z","updated_at":"2018-03-19T22:20:22.000Z","dependencies_parsed_at":"2022-08-28T14:21:21.396Z","dependency_job_id":null,"html_url":"https://github.com/thecodeboss/ex_compatible","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodeboss%2Fex_compatible","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodeboss%2Fex_compatible/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodeboss%2Fex_compatible/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thecodeboss%2Fex_compatible/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thecodeboss","download_url":"https://codeload.github.com/thecodeboss/ex_compatible/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246418642,"owners_count":20773938,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-13T02:09:14.381Z","updated_at":"2025-03-31T05:09:43.333Z","avatar_url":"https://github.com/thecodeboss.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"ExCompatible\n============\n\n[![Build Status](https://travis-ci.org/thecodeboss/ex_compatible.svg?branch=master)](https://travis-ci.org/thecodeboss/ex_compatible)\n[![Coverage Status](https://coveralls.io/repos/github/thecodeboss/ex_compatible/badge.svg?branch=master)](https://coveralls.io/github/thecodeboss/ex_compatible?branch=master)\n[![Hex.pm version](https://img.shields.io/hexpm/v/ex_compatible.svg?style=flat-square)](https://hex.pm/packages/ex_compatible)\n[![Hex.pm downloads](https://img.shields.io/hexpm/dt/ex_compatible.svg?style=flat-square)](https://hex.pm/packages/ex_compatible)\n[![License](https://img.shields.io/hexpm/l/ex_compatible.svg?style=flat-square)](https://hex.pm/packages/ex_compatible)\n[![Docs](https://img.shields.io/badge/api-docs-yellow.svg?style=flat)](http://hexdocs.pm/ex_compatible/)\n\nExCompatible strives to make your Elixir code compatible with as many Elixir\nversions as possible, while reducing the number of compiler warnings.\n\nSee [http://hexdocs.pm/ex_compatible/](http://hexdocs.pm/ex_compatible/) for\ndocumentation,\n [https://github.com/kafkaex/ex_compatible/](https://github.com/kafkaex/ex_compatible/)\n for code.\n\nHave you ever wanted to use `String.to_charlist/1`, but then your code no longer\ncompiles on Elixir 1.1? You switch to using `String.to_char_list/1` instead,\nbut now your compiler spits out annoying warnings on Elixir 1.5. What should\nyou do?\n\nExCompatible can inspect your Elixir version, and by using the `compatible`\nmacro, it will always inject the most appropriate version of a defition so your\ncompiler stays happy.\n\n**Note:** This project is still under heavy construction. Please check the to-do\nlist further down, and we love contributors!\n\n## Usage\n\nTo add ExCompatible to your Elixir application, change the `deps` definition\nin your `mix.exs` file:\n\n```elixir\ndefp deps do\n  [\n    {:ex_compatible, \"~\u003e 0.2\"}\n  ]\nend\n```\n\nThen you will need to import the `compatible/1` macro inside any modules in\nwhich you would like to use it. For example:\n\n```elixir\ndefmodule MyModule do\n  import ExCompatible, only: [compatible: 1]\n\n  def my_def do\n    IO.puts compatible(String.to_char_list(\"Hello world!\"))\n\n    compatible do\n      Enum.partition([5, 4, 3, 2], fn(x) -\u003e rem(x, 2) == 0 end)\n    end\n  end\nend\n```\n\n## Performance\n\nExCompatible is implemented using macros, which always inject the most\nappropriate version of a given definition directly into the AST. This happens at\ncompile time, so at runtime there should be **zero** performance impact by\nusing ExCompatible.\n\n## To-do\n\nThere are lots of different types of deprecations, ranging from simple renames,\nto spec changes, complete removal, or splits into multiple functions. The goal\nis to be able to handle all of these different types, and to do that we'll need\na checklist.\n\n### Elixir 1.6 Deprecations\n\n- [x] `Enum.partition/2`\n- [ ] `Keyword.replace/3`\n- [ ] `Macro.unescape_tokens/1` and `Macro.unescape_tokens/2`\n- [ ] `Module.add_doc/6`\n- [ ] `Map.replace/3`\n- [ ] `Range.range?/1`\n\n### Elixir 1.5 Deprecations\n\n- [x] `Atom.to_char_list/1`\n- [ ] `Enum.filter_map/3`\n- [x] `Float.to_char_list/1`\n- [ ] `GenEvent` module\n- [x] `Integer.to_char_list/1` and `Integer.to_char_list/2`\n- [x] `Kernel.to_char_list/1`\n- [x] `List.Chars.to_char_list/1`\n- [ ] `Stream.filter_map/3`\n- [ ] `String.ljust/3` and `String.rjust/3`\n- [x] `String.strip/1` and `String.strip/2`\n- [ ] `String.lstrip/1` and `String.rstrip/1`\n- [ ] `String.lstrip/2` and `String.rstrip/2`\n- [x] `String.to_char_list/1`\n- [ ] `()` to mean `nil`\n- [ ] `:as_char_lists` value in `t:Inspect.Opts.t/0` type\n- [ ] `:char_lists` key in `t:Inspect.Opts.t/0` type\n- [ ] `char_list/0` type\n- [ ] `@compile {:parse_transform, _}` in `Module`\n- [ ] EEx: `\u003c%=` in middle and end expressions\n\n### Elixir 1.4 Deprecations\n\n- [ ] `Access.key/1`\n- [ ] `Behaviour` module\n- [ ] `Enum.uniq/2`\n- [ ] `Float.to_char_list/2`\n- [ ] `Float.to_string/2`\n- [ ] `HashDict` module\n- [ ] `HashSet` module\n- [ ] `Set` module\n- [ ] `Stream.uniq/2`\n- [ ] `IEx.Helpers.import_file/2`\n- [ ] `Mix.Utils.camelize/1`\n- [ ] `Mix.Utils.underscore/1`\n- [ ] Variable used as function call\n- [ ] Anonymous functions with no expression after `-\u003e`\n\n### Elixir 1.3 Deprecations\n\n- [ ] `Dict` module\n- [ ] `Keyword.size/1`\n- [ ] `Map.size/1`\n- [ ] `Set` behaviour\n- [ ] `String.valid_character?/1`\n- [ ] `Task.find/2`\n- [ ] `:append_first` option in `Kernel.defdelegate/2`\n- [ ] `/r` option in `Regex`\n- [ ] `\\x{X*}` inside strings/sigils/charlists\n- [ ] Map or dictionary as second argument in `Enum.group_by/3`\n- [ ] Non-map as second argument in `URI.decode_query/2`\n\n### Elixir 1.2 Deprecations\n\n- [ ] `Dict` behaviour\n\n### Elixir 1.1 Deprecations\n\n- [ ] `Access` protocol\n- [ ] `as: true \\| false` in `alias/2` and `require/2`\n- [ ] `?\\xHEX`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodeboss%2Fex_compatible","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecodeboss%2Fex_compatible","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecodeboss%2Fex_compatible/lists"}