# Major change to package, but not the interface

**URL:** <https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622>\
**Category:** Learn\
**Created:** [December 11, 2020, 9:46pm UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622 "2020-12-11T21:46:08Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jweir](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jweir/32/447_2.png) [@jweir](https://discourse.elm-lang.org/u/jweir)\
**Post date:** [December 11, 2020, 9:46pm UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622/1 "2020-12-11T21:46:08Z")

</div>

I have a library which parses via RegEx. The RegEx has been updated, and could be a breaking change for a user. However Elm diff considers this to be patch. I think it should be a major change and communicate this via the version number.

Is there a way to force publish a major version change?

---

<div class="post-metadata">

**Author:** ![Sebastian](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/sebastian/32/98_2.png) [@Sebastian](https://discourse.elm-lang.org/u/Sebastian)\
**Post date:** [December 11, 2020, 10:27pm UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622/2 "2020-12-11T22:27:03Z")

</div>

One way I have done this in the past is to add a dummy function to the public API e.g. `isVersion1 = True`. Then publish a minor version.

Then remove that or change it. At that point Elm will force me to publish a major.

I would like to know if there is a better way too.

---

<div class="post-metadata">

**Author:** ![DullBananas](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dullbananas/32/3709_2.png) [@DullBananas](https://discourse.elm-lang.org/u/DullBananas)\
**Post date:** [December 12, 2020, 5:31pm UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622/3 "2020-12-12T17:31:37Z")

</div>

Make sure you don’t add the breaking changes in the minor release

---

<div class="post-metadata">

**Author:** ![dta](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dta/32/1917_2.png) [@dta](https://discourse.elm-lang.org/u/dta)\
**Post date:** [December 12, 2020, 7:33pm UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622/4 "2020-12-12T19:33:33Z")

</div>

Don’t you specify the library version in elm.json? What is preventing you from updating the major version?

---

<div class="post-metadata">

**Author:** ![jweir](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jweir/32/447_2.png) [@jweir](https://discourse.elm-lang.org/u/jweir)\
**Post date:** [December 12, 2020, 7:51pm UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622/5 "2020-12-12T19:51:35Z")

</div>

I have manually adjusted the elm.json to be an 8.0 version (elm bump wants a 7.0.1). On publish Elm checks the versions, the output below.

```auto
  ✗ Version 8.0.0 is not correct!

-- INVALID VERSION ---------------------------------------------------- elm.json

Your elm.json says the next version should be 8.0.0, indicating a MAJOR change
to the public API. This does not match the API diff given by:

    elm diff 7.0.0

```

---

<div class="post-metadata">

**Author:** ![dta](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/dta/32/1917_2.png) [@dta](https://discourse.elm-lang.org/u/dta)\
**Post date:** [December 13, 2020, 5:03am UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622/6 "2020-12-13T05:03:11Z")

</div>

Well that’s obnoxious. It sounds like Sebastian’s workaround will work for you. May I ask what the package is?

---

<div class="post-metadata">

**Author:** ![jessta](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/jessta/32/660_2.png) [@jessta](https://discourse.elm-lang.org/u/jessta)\
**Post date:** [December 14, 2020, 2:50am UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622/7 "2020-12-14T02:50:16Z")

</div>

If you have a breaking change that isn’t an API change then I recommend making it an API change. This will solve your releasing problem while also allowing the compiler to help consumers of the package identify the breakage when they upgrade.

---

<div class="post-metadata">

**Author:** ![hexedhash](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/hexedhash/32/3384_2.png) [@hexedhash](https://discourse.elm-lang.org/u/hexedhash)\
**Post date:** [December 16, 2020, 4:25am UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622/8 "2020-12-16T04:25:51Z")

</div>

Without sufficient context none of us can say with certainty that “making it an API change” is sensible.

Here’s another example:

> <https://github.com/elm/compiler/issues/2145>
>
> Quick Summary: I maintain a UI library which recently had a visual breaking change. However elm diff is not able to...

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/elm_lang/original/1X/50a05e53677a2c3b47776d7abd0f113eb50193a1.png) [@system](https://discourse.elm-lang.org/u/system)\
**Post date:** [December 26, 2020, 4:25am UTC](https://discourse.elm-lang.org/t/major-change-to-package-but-not-the-interface/6622/9 "2020-12-26T04:25:52Z")

</div>

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