Closed
Description
Summary
Some JS files are direct children of web
rather than web/js
. This does not follow instructions from the dev docs thus is confusing.
Place the custom component source file in one of the following locations:
Your theme JS files: /web/js or /_/web/js
Your module view JS files: <module_dir>/view/frontend/web/js
There are more instances of this:
vendor/magento/module-payment/view/frontend/web/transparent.js
vendor/magento/module-payment/view/frontend/web/cc-type.js
vendor/magento/module-search/view/frontend/web/form-mini.js
vendor/magento/module-sales/view/frontend/web/gift-message.js
There are more but I'm pushed for time at the minute.
Preconditions
- Magento 2.2 - This is irrelevant as it appears in all versions
Steps to reproduce
- Go to https://github.com/magento/magento2/tree/2.2-develop/app/code/Magento/Captcha/view/frontend/web and look where
captcha.js
andonepage.js
is located.
Expected result
- JS files to be inside
web/js
as per the dev docs.
Actual result
- JS files are direct children of
web
, this is inconsistent with the dev docs.
This is confusing as the dev docs instructs developers to use certain locations yet the core does not follow this, either the files should be relocated to be inside web/js
or the dev docs should be updated. Unless there is a valid reason why the files are outside web/js
?
Metadata
Metadata
Assignees
Labels
The issue has been fixed in 2.2 release lineThe issue has been fixed in 2.3 release lineGate 2 Passed. Manual verification of the issue description passedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedGate 1 Passed. Automatic verification of issue format passedGate 4. Acknowledged. Issue is added to backlog and ready for developmentThe issue has been reproduced on latest 2.1 releaseThe issue has been reproduced on latest 2.2 releaseThe issue has been reproduced on latest 2.3 release