surface-ui / surface

A server-side rendering component library for Phoenix
https://surface-ui.org
MIT License
2.08k stars 150 forks source link

Elixir 1.16: negative steps are not supported in String.slice/2, pass 1..-2//1 instead #717

Closed jfpedroza closed 10 months ago

jfpedroza commented 10 months ago

Describe the bug

After updating to Elixir 1.16, compilation fails with the following warning:

warning: negative steps are not supported in String.slice/2, pass 1..-2//1 instead
  (elixir 1.16.0) lib/string.ex:2368: String.slice/2
  (surface 0.11.1) lib/surface/api.ex:641: anonymous fn/2 in Surface.API.generate_props_docs/1
  (elixir 1.16.0) lib/enum.ex:2528: Enum."-reduce/3-lists^foldl/2-0-"/3
  (surface 0.11.1) lib/surface/api.ex:639: Surface.API.generate_props_docs/1
  (surface 0.11.1) lib/surface/api.ex:622: Surface.API.do_generate_docs/2
  (surface 0.11.1) lib/surface/api.ex:73: Surface.API."MACRO-__before_compile__"/2

How to reproduce it

  1. Compile a project with latest surface and latest Elixir

The behavior you expected

No warning

Your Environment

Surface: v0.11.1 LiveView: v0.19.5 Elixir: v1.16.0