Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of mixins for modules with no dependencies defined #27690

Merged
merged 2 commits into from
Jun 5, 2020

Conversation

krzksz
Copy link
Contributor

@krzksz krzksz commented Apr 10, 2020

Description (*)

This PR addresses an issue that was outlined in #25587 (comment) and investigated by me afterwards.

This is a regression I have introduced when refactoring mixins module, but it applies only in two cases which are not present in the Magento itself:

// Module defined as anything else then a function with dependencies skipped.
define('my-module', {
  foo: 'bar'
});
// Module defined with dependencies passed as "null".
define('my-module', null, {
  foo: 'bar'
});

which both results in special case where second element of RequireJS's defQueue is null and made the script throw an error when somebody required such module.

Manual testing scenarios (*)

  1. Open the store.
  2. Open browser console.
  3. Paste and execute the following code:
define('my-module', {
  foo: 'bar'
});
require(['my-module', function(){});
  1. Verify that no error similar to TypeError: Cannot read property 'map' of null is thrown.

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Resolved issues:

  1. resolves [Issue] Fix handling of mixins for modules with no dependencies defined #28340: Fix handling of mixins for modules with no dependencies defined

@m2-assistant
Copy link

m2-assistant bot commented Apr 10, 2020

Hi @krzksz. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failing functional test not related to changes from this PR>

@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-7447 has been created to process this Pull Request

@engcom-Alfa
Copy link
Contributor

✔️ QA Passed

Manual testing scenario:

  1. Go to Storefront;
  2. Open browser console;
  3. Paste and execute the following code:
define('my-module', {
  foo: 'bar'
});
require(['my-module'], function(){});

Before: ✔️
Screenshot from 2020-04-17 10-49-52

After: ✖️
Screenshot from 2020-04-17 10-54-11

@VladimirZaets VladimirZaets added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Apr 21, 2020
@VladimirZaets VladimirZaets added Progress: accept QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) and removed Progress: extended testing Progress: accept labels May 20, 2020
@sdzhepa
Copy link
Contributor

sdzhepa commented May 22, 2020

@magento run Functional Tests B2B,Functional Tests CE

@sdzhepa
Copy link
Contributor

sdzhepa commented May 22, 2020

@magento create issue

@sdzhepa sdzhepa linked an issue May 22, 2020 that may be closed by this pull request
4 tasks
@magento-engcom-team magento-engcom-team added QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope and removed QA: Ready to add to Regression Scope Should be analyzed and added to Regression Testing Scope(if applicable) labels May 22, 2020
@engcom-Echo
Copy link
Contributor

@magento run Functional Tests B2B,Functional Tests CE

@engcom-Echo
Copy link
Contributor

Failed functional tests not related to the changes in this PR

@ghost ghost added the Progress: accept label May 28, 2020
@magento-engcom-team magento-engcom-team merged commit ced558a into magento:2.4-develop Jun 5, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jun 5, 2020

Hi @krzksz, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Lib/Frontend Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: bug fix Award: test coverage Partner: creativestyle partners-contribution Pull Request is created by Magento Partner Priority: P3 May be fixed according to the position in the backlog. Progress: accept QA: Added to Regression Scope Scenario was analysed and added to Regression Testing Scope Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[Issue] Fix handling of mixins for modules with no dependencies defined
8 participants