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

JS files located outside the web/js directory #16302

Closed
BenSpace48 opened this issue Jun 21, 2018 · 11 comments

Comments

@BenSpace48
Copy link
Contributor

commented Jun 21, 2018

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

  1. Magento 2.2 - This is irrelevant as it appears in all versions

Steps to reproduce

  1. Go to https://github.com/magento/magento2/tree/2.2-develop/app/code/Magento/Captcha/view/frontend/web and look where captcha.js and onepage.js is located.

Expected result

  1. JS files to be inside web/js as per the dev docs.

Actual result

  1. 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?

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

commented Jun 21, 2018

Hi @BenSpace48. Thank you for your report.
To help us process this issue please make sure that you provided the following information:

  • Summary of the issue
  • Information on your environment
  • Steps to reproduce
  • Expected and actual results

Please make sure that the issue is reproducible on the vanilla Magento instance following Steps to reproduce. To deploy vanilla Magento instance on our environment, please, add a comment to the issue:

@magento-engcom-team give me {$VERSION} instance

where {$VERSION} is version tags (starting with 2.2.0+) or develop branches (2.2-develop +).
For more details, please, review the Magento Contributor Assistant documentation

@engcom-backlog-pb

This comment has been minimized.

Copy link

commented Jul 4, 2018

@BenSpace48, thank you for your report.
We've acknowledged the issue and added to our backlog.

@hitesh-wagento

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2018

Hi @BenSpace48

Do you need below files in web/js folder and captcha.js and onepage.js ?

  • 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
@BenSpace48

This comment has been minimized.

Copy link
Contributor Author

commented Jul 5, 2018

Hi @hitesh-wagento

Yeah for consistency with the dev docs and other files, and general best practices.

I think there are more files than the ones I've listed, they were just the first few I discovered whilst looking into it.

@hitesh-wagento

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2018

Ok Thanks @BenSpace48

I am working on this PR

@BenSpace48

This comment has been minimized.

Copy link
Contributor Author

commented Aug 28, 2018

@magento-engcom-team give me 2.2.5 instance

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

commented Aug 28, 2018

Hi @BenSpace48. Thank you for your request. I'm working on Magento 2.2.5 instance for you

@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

commented Aug 28, 2018

Hi @BenSpace48, here is your Magento instance.
Admin access: https://i-16302-2-2-5.engcom.dev.magento.com/admin
Login: admin Password: 123123q
Instance will be terminated in up to 3 hours.

@ishakhsuvarov

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2018

Hi @BenSpace48. Thank you for your report.
The issue has been fixed in #16708 by @hitesh-wagento in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.0 release.

rbayet added a commit to rbayet/elasticsuite that referenced this issue Nov 19, 2018
Fixes Smile-SA#1186 - support web/js files relocation
To be introduced in 2.3.x and 2.2.7
With expected BC break in 2.2.x because magento/magento2#16582 does not seem to cover this particular case
See issue of origin magento/magento2#16302
@rbayet rbayet referenced this issue Dec 5, 2018
4 of 4 tasks complete
@magento-engcom-team

This comment has been minimized.

Copy link
Contributor

commented Dec 10, 2018

Hi @BenSpace48. Thank you for your report.
The issue has been fixed in #19583 by @rbayet in 2.3-develop branch
Related commit(s):

The fix will be available with the upcoming 2.3.1 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.