2.1.0-RC1, SemVer and Major version bump

We are very excited to publish Release Candidate for Magento 2.1.0 – our new major release, and hear your feedback before 2.1.0 GA released (it will be soon). Even though we are bumping “minor” digit in product version, it still major release. Let’s keep marketing product version aside, and focus on modules.

With the new CE 2.1.0-RC1 release you will find there are two modules with bumped major version (to 101.0.0-RC1) – Catalog and CMS. Thank you to our parter Fooman for noticing this.

Actually there is another one in only in Enterprise Edition – GiftCard.

So, what these changes are? We have changed API in the modules, particularly we changed few interfaces. But, very important to share with you – we did not change signature of existing methods (relief), what we have done is – “incremental interface changes”. It means, if your extension is using the interfaces as a client – then nothing need to be done, the extensions will work with 2.1.0-RC1 as is. If you implemented the interfaces in your extensions, then you will require to add implementation of the new public methods, or just reuse our implementation.

Which interfaces? Let’s look together:

CMS

For quick answer – check the PR we accepted from Marius (and BIG thanks for PR) –https://github.com/magento/magento2/pull/3636/files.  If you run semantic checker on the code, it will show code V034 in app/code/Magento/Cms/Api/Data/PageInterface.php  for two lines. It means the interface app/code/Magento/Cms/Api/Data/PageInterface.php has two new public methods, which basically trigger major version change. Screen Shot 2016-05-24 at 9.51.50 AM.png

Catalog

The similar situation with Catalog. We didn’t change existing signature, but we added public methods in API.

app/code/Magento/Catalog/Api/ProductCustomOptionRepositoryInterface.php

Added public methods – getProductOptions  and duplicate:

/**
 * @api
 */
interface ProductCustomOptionRepositoryInterface
{
    ...
    /**
     * @param \Magento\Catalog\Api\Data\ProductInterface $product
     * @param bool $requiredOnly
     * @return \Magento\Catalog\Api\Data\ProductCustomOptionInterface[]
     */
    public function getProductOptions(
        \Magento\Catalog\Api\Data\ProductInterface $product,
        $requiredOnly = false
    );
    ...
    /**
     * Duplicate product options
     *
     * @param \Magento\Catalog\Api\Data\ProductInterface $product
     * @param \Magento\Catalog\Api\Data\ProductInterface $duplicate
     * @return mixed
     */
    public function duplicate(
        \Magento\Catalog\Api\Data\ProductInterface $product,
        \Magento\Catalog\Api\Data\ProductInterface $duplicate
    );
    ...

 

app/code/Magento/Catalog/Api/ProductLinkRepositoryInterface.php

Added public method – getList

/**
 * Interface Product links handling interface
 * @api
 */
interface ProductLinkRepositoryInterface
{
    /**
     * Get product links list
     *
     * @param \Magento\Catalog\Api\Data\ProductInterface $product
     * @return \Magento\Catalog\Api\Data\ProductLinkInterface[]
     */
    public function getList(\Magento\Catalog\Api\Data\ProductInterface $product);
     ...

 

EE only – GiftCard

It is related for Enterprise Edition only, so no link provided, since only partners and EE clients have access to the code.

app/code/Magento/GiftCard/Api/Data/GiftcardAmountInterface.php

Added public methods – getAttributeId and setAttribuetId

/**
 * Interface GiftcardAmountInterface: this interface is used to serialize and deserialize
 * EAV attribute giftcard_amounts
 *
 * @api
 */
interface GiftcardAmountInterface extends ExtensibleDataInterface
{
    /**
     * @return int
     */
    public function getAttributeId();
    /**
     * @param int $attributeId
     * @return $this
     */
    public function setAttributeId($attributeId);

    ...

 

Summary

We are continuously improving our platform and it requires us to do backward incompatible changes, even though we are trying to minimize them. Particular example of “minimizing” for RC1 – we extended API, but not changed signatures of existing methods.

At the moment we are looking for feedback from partners and extension developers. If you think – the major changes are too impactful for your code, let us (me) know. We really want to hear your experience and make it better.

The feedback is important for us to understand how often we can do platform improvements with backward incompatible changes, because the type of changes – help us improve Magento platform and keep it clean. Please note – we will make sure we are documenting and guiding you throw the changes and we will do it together, so we will try to minimize impact on you.

Ping me in twitter, send me email – we eager to hear from your!

We are Magento!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s