Update external barcodes library tecnickcom/tc-lib-barcode

Created on 6 February 2024, 11 months ago
Updated 29 August 2024, 4 months ago

Problem/Motivation

tecnickcom/tc-lib-barcode published a new major version that includes backwards incompatible changes.

Steps to reproduce

Proposed resolution

Remaining tasks

- The project page will also have to be updated for the new barcode types.

User interface changes

API changes

Data model changes

πŸ“Œ Task
Status

Fixed

Version

2.1

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany sanduhrs πŸ‡ͺπŸ‡Ί Heidelberg, Germany, Europe

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @sanduhrs
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    last update 11 months ago
    Composer require failure
  • Status changed to Needs review 11 months ago
  • πŸ‡©πŸ‡ͺGermany sanduhrs πŸ‡ͺπŸ‡Ί Heidelberg, Germany, Europe
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Nice work. A couple of comments.

    I think to do this we should bump the release number of the Barcodes module, since we're dealing with a backwards incompatible change. Hopefully we can get away with a minor point release and not have to do a major point release - I would have to research the Drupal guidelines for this. What I am concerned about is because this is an incompatible change, updating the module with drush or the Drupal UI won't work. Or rather the update *will* work but the library won't get updated this way so the site will crash when Barcodes is used next. With this change, the new library has to be installed via composer, which may not be a typical workflow step.

    @todo The project page will also have to be updated for the new barcode types.

    I see you made changes in the README like this:

    -* C39E: CODE 39 EXTENDED
    +* CODE 39 EXTENDED

    Aren't the array indexes still relevant (albeit only for programmers) ? We also use the array indexes (e.g. "C39E") to map CSS libraries to the barcode type, so even for someone who just wants to figure out how to style a particular barcode type, the index is useful.

    Is there a need or use case for adding barcode.html.twig?

  • πŸ‡©πŸ‡ͺGermany sanduhrs πŸ‡ͺπŸ‡Ί Heidelberg, Germany, Europe
  • πŸ‡©πŸ‡ͺGermany sanduhrs πŸ‡ͺπŸ‡Ί Heidelberg, Germany, Europe

    Thanks for the feedback.

    #4.1 We should bump the release number
    The recommendation to install the module on the project page is composer require 'drupal/barcodes:^2.0'.
    As per semantic versioning we should bump
    * major in case we make incompatible API changes.
    * minor in case we add functionality in a backward compatible manner

    As we do not expose the library as a public API, I see no point in bumping major, unless we break sites if we don't.

    Given constraint of ^2.0 as recommended on the project's page and semantic versioning

    A minor version bump:
    * bumping to 2.1
    * composer update will update the module, as well as the library
    * drush or Drupal UI will break the site as the library will stay outdated

    A major version bump:
    * bumping to 3.0
    * composer update will update neither the module nor the library
    * it will therefore be a more conscious process to upgrade
    * updating manually with drush or Drupal UI will break the site as well

    As the initial install of the module needs to be done with composer require already - for getting the library and generating the autoloader - isn't it safe to assume any updates will be done that way?

    #4.2 The project page will also have to be updated for the new barcode types
    Added the todo to the issue summary

    #4.3 Aren't the array indexes still relevant
    I agree, readded the barcode identifiers to the docs, but behind the description for better readability.

    #4.4 Is there a need or use case for adding barcode.html.twig?
    Drupal 10 was trying to fall back to it when it didn't find the specific template for a new barcode type.

  • Merge request !17Resolve #3419473 β†’ (Merged) created by tr
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    TR β†’ changed the visibility of the branch 3419473-update-external-barcodes to hidden.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    Updated MR to apply to 2.1.x.

  • Pipeline finished with Skipped
    4 months ago
    #244998
    • TR β†’ committed 982b02db on 2.1.x
      Issue #3419473 by sanduhrs, TR: Update external barcodes library...
  • Status changed to Fixed 4 months ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia
  • πŸ‡³πŸ‡΄Norway hansfn

    Just a minor comment: Shouldn't tecnickcom/tc-lib-barcode be listed on the project page to give proper credit?

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    @hansfn: Thanks for the suggestion. I have done that on the project page and the documentation guide and am working on updating the README. I also changed the project page for the similar modules, to mention which external libraries they are using for comparison.

    I think drupal.org should probably have a place on the project page that modules can use to list their external dependencies - right now as far as I can see very few modules do this. This info could probably be generated automatically by looking at composer.json - that would go a long way to ensuring the Drupal community gave due credit to other open source projects.

  • πŸ‡³πŸ‡΄Norway hansfn

    Thx, TR, for actually responding to my comment - I appreciate it.

    Yes, listing external dependencies on the project page automatically based on the composer.json file would be nice.

Production build 0.71.5 2024