diff --git a/Block/Adminhtml/System/Config/Form/Info.php b/Block/Adminhtml/System/Config/Form/Info.php index 4377ab4..5401914 100755 --- a/Block/Adminhtml/System/Config/Form/Info.php +++ b/Block/Adminhtml/System/Config/Form/Info.php @@ -1,7 +1,7 @@ moduleList = $moduleList; + protected function getModuleUrl() + { + return 'https://mage' . 'fan.com/rocket-javascript-deferred-javascript'; } /** - * Return info block html - * @param \Magento\Framework\Data\Form\Element\AbstractElement $element + * Return extension title * @return string */ - public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) + protected function getModuleTitle() { - $m = $this->moduleList->getOne($this->getModuleName()); - $html = '
- Rocket JavaScript Extension v' . $m['setup_version'] . ' was developed by Magefan. -
'; - - return $html; + return 'Rocket JavaScript Extension'; } - } diff --git a/LICENSE.txt b/LICENSE.txt index d6e263a..aa5423f 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,45 +1 @@ -This Open Software License (the "License") applies to any original work of authorship (the "Original Work") whose owner (the "Licensor") has placed the following licensing notice adjacent to the copyright notice for the Original Work: - -Licensed under the Open Software License version 3.0 - -1) Grant of Copyright License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, for the duration of the copyright, to do the following: - -a) to reproduce the Original Work in copies, either alone or as part of a collective work; - -b) to translate, adapt, alter, transform, modify, or arrange the Original Work, thereby creating derivative works ("Derivative Works") based upon the Original Work; - -c) to distribute or communicate copies of the Original Work and Derivative Works to the public, with the proviso that copies of Original Work or Derivative Works that You distribute or communicate shall be licensed under this Open Software License; - -d) to perform the Original Work publicly; and - -e) to display the Original Work publicly. - -2) Grant of Patent License. Licensor grants You a worldwide, royalty-free, non-exclusive, sublicensable license, under patent claims owned or controlled by the Licensor that are embodied in the Original Work as furnished by the Licensor, for the duration of the patents, to make, use, sell, offer for sale, have made, and import the Original Work and Derivative Works. - -3) Grant of Source Code License. The term "Source Code" means the preferred form of the Original Work for making modifications to it and all available documentation describing how to modify the Original Work. Licensor agrees to provide a machine-readable copy of the Source Code of the Original Work along with each copy of the Original Work that Licensor distributes. Licensor reserves the right to satisfy this obligation by placing a machine-readable copy of the Source Code in an information repository reasonably calculated to permit inexpensive and convenient access by You for as long as Licensor continues to distribute the Original Work. - -4) Exclusions From License Grant. Neither the names of Licensor, nor the names of any contributors to the Original Work, nor any of their trademarks or service marks, may be used to endorse or promote products derived from this Original Work without express prior permission of the Licensor. Except as expressly stated herein, nothing in this License grants any license to Licensor's trademarks, copyrights, patents, trade secrets or any other intellectual property. No patent license is granted to make, use, sell, offer for sale, have made, or import embodiments of any patent claims other than the licensed claims defined in Section 2. No license is granted to the trademarks of Licensor even if such marks are included in the Original Work. Nothing in this License shall be interpreted to prohibit Licensor from licensing under terms different from this License any Original Work that Licensor otherwise would have a right to license. - -5) External Deployment. The term "External Deployment" means the use, distribution, or communication of the Original Work or Derivative Works in any way such that the Original Work or Derivative Works may be used by anyone other than You, whether those works are distributed or communicated to those persons or made available as an application intended for use over a network. As an express condition for the grants of license hereunder, You must treat any External Deployment by You of the Original Work or a Derivative Work as a distribution under section 1(c). - -6) Attribution Rights. You must retain, in the Source Code of any Derivative Works that You create, all copyright, patent, or trademark notices from the Source Code of the Original Work, as well as any notices of licensing and any descriptive text identified therein as an "Attribution Notice." You must cause the Source Code for any Derivative Works that You create to carry a prominent Attribution Notice reasonably calculated to inform recipients that You have modified the Original Work. - -7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that the copyright in and to the Original Work and the patent rights granted herein by Licensor are owned by the Licensor or are sublicensed to You under the terms of this License with the permission of the contributor(s) of those copyrights and patent rights. Except as expressly stated in the immediately preceding sentence, the Original Work is provided under this License on an "AS IS" BASIS and WITHOUT WARRANTY, either express or implied, including, without limitation, the warranties of non-infringement, merchantability or fitness for a particular purpose. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU. This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No license to the Original Work is granted by this License except under this disclaimer. - -8) Limitation of Liability. Under no circumstances and under no legal theory, whether in tort (including negligence), contract, or otherwise, shall the Licensor be liable to anyone for any indirect, special, incidental, or consequential damages of any character arising as a result of this License or the use of the Original Work including, without limitation, damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses. This limitation of liability shall not apply to the extent applicable law prohibits such limitation. - -9) Acceptance and Termination. If, at any time, You expressly assented to this License, that assent indicates your clear and irrevocable acceptance of this License and all of its terms and conditions. If You distribute or communicate copies of the Original Work or a Derivative Work, You must make a reasonable effort under the circumstances to obtain the express assent of recipients to the terms of this License. This License conditions your rights to undertake the activities listed in Section 1, including your right to create Derivative Works based upon the Original Work, and doing so without honoring these terms and conditions is prohibited by copyright law and international treaty. Nothing in this License is intended to affect copyright exceptions and limitations (including "fair use" or "fair dealing"). This License shall terminate immediately and You may no longer exercise any of the rights granted to You by this License upon your failure to honor the conditions in Section 1(c). - -10) Termination for Patent Action. This License shall terminate automatically and You may no longer exercise any of the rights granted to You by this License as of the date You commence an action, including a cross-claim or counterclaim, against Licensor or any licensee alleging that the Original Work infringes a patent. This termination provision shall not apply for an action alleging patent infringement by combinations of the Original Work with other software or hardware. - -11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this License may be brought only in the courts of a jurisdiction wherein the Licensor resides or in which Licensor conducts its primary business, and under the laws of that jurisdiction excluding its conflict-of-law provisions. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any use of the Original Work outside the scope of this License or after its termination shall be subject to the requirements and penalties of copyright or patent law in the appropriate jurisdiction. This section shall survive the termination of this License. - -12) Attorneys' Fees. In any action to enforce the terms of this License or seeking damages relating thereto, the prevailing party shall be entitled to recover its costs and expenses, including, without limitation, reasonable attorneys' fees and costs incurred in connection with such action, including any appeal of such action. This section shall survive the termination of this License. - -13) Miscellaneous. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. - -14) Definition of "You" in This License. "You" throughout this License, whether in upper or lower case, means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with you. For purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. - -15) Right to Use. You may use the Original Work in all ways not otherwise restricted or conditioned by this License or by law, and Licensor promises not to interfere with or be responsible for such uses by You. - -16) Modification of This License. This License is Copyright © 2005 Lawrence Rosen. Permission is granted to copy, distribute, or communicate this License without modification. Nothing in this License permits You to modify this License as applied to the Original Work or to Derivative Works. However, You may modify the text of this License and copy, distribute or communicate your modified version (the "Modified License") and apply it to other original works of authorship subject to the following conditions: (i) You may not indicate in any way that your Modified License is the "Open Software License" or "OSL" and you may not use those names in the name of your Modified License; (ii) You must replace the notice specified in the first paragraph above with the notice "Licensed under " or with a notice of your own that is not confusingly similar to the notice in this License; and (iii) You may not claim that your original works are open source software unless your Modified License has been approved by Open Source Initiative (OSI) and You comply with its license review and certification process. \ No newline at end of file +Please visit Magefan.com for license details (https://magefan.com/end-user-license-agreement) \ No newline at end of file diff --git a/Model/Config.php b/Model/Config.php new file mode 100644 index 0000000..68d0ae7 --- /dev/null +++ b/Model/Config.php @@ -0,0 +1,156 @@ +scopeConfig = $scopeConfig; + } + + /** + * Retrieve true if module is enabled + * + * @param string|null $storeId + * @return bool + */ + public function isEnabled(?string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_EXTENSION_ENABLED, $storeId); + } + + /** + * Retrieve true if deferred is enabled + * + * @param string|null $storeId + * @return bool + */ + public function isDeferredEnabled(?string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_DEFERRED_ENABLED, $storeId); + } + + /** + * Retrieve Disallowed Pages + * + * @param string|null $storeId + * @return string + */ + public function getDisallowedPages(?string $storeId = null): string + { + return (string)$this->getConfig(self::XML_PATH_DEFERRED_DISALLOWED_PAGES, $storeId); + } + + /** + * Retrieve Ignore JS + * + * @param string|null $storeId + * @return string + */ + public function getIgnoreJavaScript(?string $storeId = null): string + { + return (string)$this->getConfig(self::XML_PATH_DEFERRED_IGNORE_JAVASCRIPT, $storeId); + } + + /** + * Retrieve true if JS bundling is enabled + * + * @param string|null $storeId + * @return bool + */ + public function isBundlingEnabled(?string $storeId = null): bool + { + return (bool)$this->getConfig(MagentoConfig::XML_PATH_JS_BUNDLING, $storeId); + } + + /** + * Retrieve true if bundling optimization is enabled + * @return bool + */ + public function isBundlingOptimizationEnabled(): bool + { + return (bool)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_OPTIMIZATION_ENABLED); + } + + /** + * Retrieve included in bundling JS + * @return string + */ + public function getIncludedInBundling(): string + { + return (string)$this->getConfig(self::XML_PATH_JAVASCRIPT_BUNDLING_INCLUDED_IN_BUNDLING); + } + + /** + * Retrieve true if amp enabled + * + * @param string|null $storeId + * @return bool + */ + public function isAmpRequest(?string $storeId = null): bool + { + return (bool)$this->getConfig(self::XML_PATH_PLUMROCKET_AMP_ENABLED, $storeId); + } + + /** + * Retrieve store config value + * + * @param string $path + * @param string|null $storeId + * @return mixed + */ + public function getConfig(string $path, ?string $storeId = null) + { + return $this->scopeConfig->getValue($path, ScopeInterface::SCOPE_STORE, $storeId); + } +} diff --git a/Model/Config/Backend/DevSettings.php b/Model/Config/Backend/DevSettings.php new file mode 100644 index 0000000..e4b67ed --- /dev/null +++ b/Model/Config/Backend/DevSettings.php @@ -0,0 +1,91 @@ + 'dev/js/merge_files', + 'mfrocketjavascript/general/minify_files' => 'dev/js/minify_files', + 'mfrocketjavascript/javascript_bundling/enabled' => 'dev/js/enable_js_bundling', + ]; + + /** + * @var RequestInterface + */ + private $request; + + /** + * DevSettings constructor. + * @param Context $context + * @param Registry $registry + * @param ScopeConfigInterface $config + * @param TypeListInterface $cacheTypeList + * @param RequestInterface $request + * @param AbstractResource|null $resource + * @param AbstractDb|null $resourceCollection + * @param array $data + */ + public function __construct( + Context $context, + Registry $registry, + ScopeConfigInterface $config, + TypeListInterface $cacheTypeList, + RequestInterface $request, + ?AbstractResource $resource = null, + ?AbstractDb $resourceCollection = null, + array $data = [] + ) { + $this->request = $request; + parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data); + } + + /** + * @return DevSettings|void + */ + public function afterLoad() + { + $scopeTypes = [ + StoreScopeInterface::SCOPE_WEBSITES, + StoreScopeInterface::SCOPE_WEBSITE, + StoreScopeInterface::SCOPE_STORES, + StoreScopeInterface::SCOPE_STORE + ]; + + $scopeType = ScopeConfigInterface::SCOPE_TYPE_DEFAULT; + $scopeCode = null; + + foreach ($scopeTypes as $scope) { + $param = $this->request->getParam($scope); + if ($param) { + $scopeType = $scope; + $scopeCode = $param; + } + } + + $devSettingsValue = $this->_config->getValue( + self::KEY_VALUE_RELATION[$this->getData('path')], + $scopeType, + $scopeCode + ); + $this->setData('value', $devSettingsValue); + } +} diff --git a/Model/Controller/ResultPlugin.php b/Model/Controller/ResultPlugin.php index 1e609b3..ad9c5a0 100644 --- a/Model/Controller/ResultPlugin.php +++ b/Model/Controller/ResultPlugin.php @@ -1,7 +1,7 @@ request = $request; - $this->scopeConfig = $scopeConfig; + $this->config = $config; + + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); + $this->storeManager = $storeManager ?: $objectManager->get( + \Magento\Store\Model\StoreManagerInterface::class + ); } /** @@ -55,40 +71,74 @@ public function aroundRenderResult( ResponseHttp $response ) { $result = $proceed($response); - if (PHP_SAPI === 'cli' || $this->request->isXmlHttpRequest() || !$this->isEnabled()) { return $result; } + if (!$this->isAllowedOnPage()) { + return $result; + } + + $ignoredStrings = $this->config->getIgnoreJavaScript() ?: ''; + $ignoredStrings = explode("\n", str_replace("\r", "\n", $ignoredStrings)); + foreach ($ignoredStrings as $key => $ignoredString) { + $ignoredString = trim($ignoredString); + if (!$ignoredString) { + unset($ignoredStrings[$key]); + } else { + $ignoredStrings[$key] = $ignoredString; + } + } + $html = $response->getBody(); + $scripts = []; - $patterns = [ - 'js' => '#(\s*)|(\s*)#isU', - ]; - - $jsHtml = []; - - foreach ($patterns as $pattern) { - $matches = array(); - $success = preg_match_all($pattern, $html, $matches); - if ($success) { - foreach ($matches[0] as $i => $js) { - if (strpos($js, self::EXCLUDE_FLAG_PATTERN) !== false) { - unset($matches[0][$i]); - } else { - $jsHtml[] = $matches[0][$i]; - } - } + $startTag = ' 1000) { + return $result; + } + + $end = stripos($html, $endTag, $start); + if (false === $end) { + break; + } + + $len = $end + strlen($endTag) - $start; + $script = substr($html, $start, $len); - $html = str_replace($matches[0], '', $html); + if (false !== stripos($script, self::EXCLUDE_FLAG_PATTERN)) { + $start++; + continue; } + + if (false !== stripos($script, 'application/ld+json')) { + $start++; + continue; + } + + foreach ($ignoredStrings as $ignoredString) { + if (false !== stripos($script, $ignoredString)) { + $start++; + continue 2; + } + } + + $html = str_replace($script, '', $html); + $scripts[] = $script; } - $jsHtml = implode($jsHtml); - if ($end = strrpos($html, '')) { - $html = substr($html, 0, $end) . $jsHtml . substr($html, $end); + $scripts = implode(PHP_EOL, $scripts); + $end = stripos($html, ''); + if ($end !== false) { + $html = substr($html, 0, $end) . $scripts . substr($html, $end); } else { - $html .= $jsHtml; + $html .= $scripts; } $response->setBody($html); @@ -98,30 +148,100 @@ public function aroundRenderResult( private function isEnabled() { - $enabled = $this->scopeConfig->getValue( - 'mfrocketjavascript/general/enabled', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); + $enabled = $this->config->isEnabled() && $this->config->isDeferredEnabled(); + - /* check if Plumrocket AMP enabled */ if ($enabled) { - $isAmpRequest = $this->scopeConfig->getValue( - 'pramp/general/enabled', - \Magento\Store\Model\ScopeInterface::SCOPE_STORE - ); - - if ($isAmpRequest) { - /* We know that using objectManager is not a not a good practice, - but if Plumrocket_AMP is not installed on your magento instance - you'll get error during di:compile */ - $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); - $isAmpRequest = $objectManager->get('\Plumrocket\Amp\Helper\Data') - ->isAmpRequest(); - } - - $enabled = !$isAmpRequest; + + /* check if Amasty AMP enabled */ + if ($this->request->getParam('is_amp')) { + return false; + } + + /* check if Plumrocket AMP enabled */ + $isAmpRequest = $this->config->isAmpRequest(); + + if ($isAmpRequest) { + /* We know that using objectManager is not a not a good practice, + but if Plumrocket_AMP is not installed on your magento instance + you'll get error during di:compile */ + $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); + $isAmpRequest = $objectManager->get('\Plumrocket\Amp\Helper\Data') + ->isAmpRequest(); + } + + $enabled = !$isAmpRequest; } return $enabled; } + + /** + * @return bool + */ + private function isAllowedOnPage() + { + if (null !== $this->allowedOnPage) { + return $this->allowedOnPage; + } + $this->allowedOnPage = false; + + $spPages = $this->config->getDisallowedPages(); + $spPages = explode("\n", str_replace("\r", "\n", $spPages)); + + foreach ($spPages as $key => $path) { + $spPages[$key] = trim($spPages[$key]); + if (empty($spPages[$key])) { + unset($spPages[$key]); + } + } + $baseUrl = trim($this->storeManager->getStore()->getBaseUrl(), '/'); + $baseUrl = str_replace('/index.php', '', $baseUrl); + + $currentUrl = $this->storeManager->getStore()->getCurrentUrl(); + $currentUrl = explode('?', $currentUrl); + $currentUrl = trim($currentUrl[0], '/'); + foreach (['index.php', '.php', '.html'] as $end) { + $el = mb_strlen($end); + $cl = mb_strlen($currentUrl); + if (mb_strrpos($currentUrl, $end) == $cl - $el) { + $currentUrl = mb_substr($currentUrl, 0, $cl - $el); + } + } + $currentUrl = str_replace('/index.php', '', $currentUrl); + $currentUrl = trim($currentUrl, '/'); + foreach ($spPages as $key => $path) { + $path = trim($path, '/'); + + if (mb_strlen($path)) { + if ('*' == $path[0]) { + $subPath = trim($path, '*/'); + if (mb_strlen($currentUrl) - mb_strlen($subPath) === mb_strrpos($currentUrl, $subPath)) { + $this->allowedOnPage = true; + break; + } + } + + if ('*' == $path[mb_strlen($path) - 1]) { + if (0 === mb_strpos($currentUrl, $baseUrl . '/' . trim($path, '*/'))) { + $this->allowedOnPage = true; + break; + } + } + if ($currentUrl == $baseUrl . '/' . trim($path, '/')) { + $this->allowedOnPage = true; + break; + } + } else { + //homepage + + if ($currentUrl == $baseUrl) { + $this->allowedOnPage = true; + break; + } + } + } + + return $this->allowedOnPage = !$this->allowedOnPage; + } } diff --git a/Observer/AdminSystemConfigChangedSection.php b/Observer/AdminSystemConfigChangedSection.php new file mode 100644 index 0000000..4005367 --- /dev/null +++ b/Observer/AdminSystemConfigChangedSection.php @@ -0,0 +1,461 @@ + 'enable_js_bundling' + ]; + + /** + * @var ScopeConfigInterface + */ + private $scopeConfig; + + /** + * @var ConfigLoader + */ + private $configLoader; + + /** + * @var TransactionFactory + */ + private $transactionFactory; + + /** + * @var ConfigStructure + */ + private $configStructure; + + /** + * @var SettingChecker + */ + private $settingChecker; + + /** + * @var ConfigValueFactory + */ + private $configValueFactory; + + /** + * @var StoreManagerInterface + */ + private $storeManager; + + /** + * @var MagentoConfig + */ + private $magentoConfig; + + /** + * @var ReinitableConfigInterface + */ + private $appConfig; + + /** + * @var null + */ + private $scope = null; + + /** + * @var null + */ + private $store = null; + + /** + * @var null + */ + private $website = null; + + /** + * @var null + */ + private $scopeId = null; + + /** + * @var null + */ + private $scopeCode = null; + + /** + * AdminSystemConfigChangedSection constructor. + * @param ScopeConfigInterface $scopeConfig + * @param ConfigLoader $configLoader + * @param TransactionFactory $transactionFactory + * @param ConfigStructure $configStructure + * @param ConfigValueFactory $configValueFactory + * @param StoreManagerInterface $storeManager + * @param MagentoConfig $magentoConfig + * @param ReinitableConfigInterface $appConfig + * @param SettingChecker|null $settingChecker + */ + public function __construct( + ScopeConfigInterface $scopeConfig, + ConfigLoader $configLoader, + TransactionFactory $transactionFactory, + ConfigStructure $configStructure, + ConfigValueFactory $configValueFactory, + StoreManagerInterface $storeManager, + MagentoConfig $magentoConfig, + ReinitableConfigInterface $appConfig, + ?SettingChecker $settingChecker = null + ) { + $this->scopeConfig = $scopeConfig; + $this->configLoader = $configLoader; + $this->transactionFactory = $transactionFactory; + $this->configStructure = $configStructure; + $this->configValueFactory = $configValueFactory; + $this->storeManager = $storeManager; + $this->magentoConfig = $magentoConfig; + $this->appConfig = $appConfig; + $this->settingChecker = $settingChecker ?: ObjectManager::getInstance()->get(SettingChecker::class); + } + + /** + * @param Observer $observer + * @return void + * @throws \Exception + */ + public function execute(Observer $observer) + { + $this->store = $observer->getData('store') ?? null; + $this->website = $observer->getData('website') ?? null; + + $this->initScope(); + + $groups = $this->scopeConfig->getValue('mfrocketjavascript', $this->scope, $this->scopeCode); + + if (!isset($groups['general']) && !isset($groups['javascript_bundling'])) { + return; + } + + $developerJsFields = []; + + foreach ($groups['general'] as $key => $value) { + if (in_array($key, self::JS_MERGE_ARRAY)) { + $developerJsFields['fields'][$key] = ['value' => $value]; + } + } + + foreach ($groups['javascript_bundling'] as $key => $value) { + if (key_exists($key, self::JS_BUNDLE_ARRAY)) { + $developerJsFields['fields'][self::JS_BUNDLE_ARRAY[$key]] = ['value' => $value]; + } + } + + $developerGroup['js'] = $developerJsFields; + $this->proceedTransaction($developerGroup, 'dev'); + } + + /** + * @param $groups + * @param $sectionId + * @throws \Exception + */ + private function proceedTransaction($groups, $sectionId) + { + $oldConfig = $this->configLoader->getConfigByPath( + 'mfrocketjavascript', + $this->scope, + $this->scopeId, + true + ); + + /** @var Transaction $deleteTransaction */ + $deleteTransaction = $this->transactionFactory->create(); + /** @var Transaction $saveTransaction */ + $saveTransaction = $this->transactionFactory->create(); + + $extraOldGroups = []; + + foreach ($groups as $groupId => $groupData) { + $this->processGroup( + $groupId, + $groupData, + $groups, + $sectionId, + $extraOldGroups, + $oldConfig, + $saveTransaction, + $deleteTransaction + ); + } + + try { + $deleteTransaction->delete(); + $saveTransaction->save(); + $this->appConfig->reinit(); + } catch (\Exception $e) { + $this->appConfig->reinit(); + throw $e; + } + } + + /** + * Process group data + * + * @param string $groupId + * @param array $groupData + * @param array $groups + * @param string $sectionPath + * @param array $extraOldGroups + * @param array $oldConfig + * @param Transaction $saveTransaction + * @param Transaction $deleteTransaction + * @return void + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + */ + private function processGroup( + $groupId, + array $groupData, + array $groups, + $sectionPath, + array &$extraOldGroups, + array &$oldConfig, + Transaction $saveTransaction, + Transaction $deleteTransaction + ) { + $groupPath = $sectionPath . '/' . $groupId; + + if (isset($groupData['fields'])) { + /** @var Group $group */ + $group = $this->configStructure->getElement($groupPath); + + // set value for group field entry by fieldname + // use extra memory + $fieldsetData = []; + foreach ($groupData['fields'] as $fieldId => $fieldData) { + $fieldsetData[$fieldId] = $fieldData['value'] ?? null; + } + + foreach ($groupData['fields'] as $fieldId => $fieldData) { + $isReadOnly = $this->settingChecker->isReadOnly( + $groupPath . '/' . $fieldId, + $this->scope, + $this->scopeCode + ); + + if ($isReadOnly) { + continue; + } + + $field = $this->getField($sectionPath, $groupId, $fieldId); + /** @var ValueInterface $backendModel */ + $backendModel = $field->hasBackendModel() + ? $field->getBackendModel() + : $this->configValueFactory->create(); + + if (!isset($fieldData['value'])) { + $fieldData['value'] = null; + } + + if ($field->getType() == 'multiline' && is_array($fieldData['value'])) { + $fieldData['value'] = trim(implode(PHP_EOL, $fieldData['value'])); + } + + $data = [ + 'field' => $fieldId, + 'groups' => $groups, + 'group_id' => $group->getId(), + 'scope' => $this->scope, + 'scope_id' => $this->scopeId, + 'scope_code' => $this->scopeCode, + 'field_config' => $field->getData(), + 'fieldset_data' => $fieldsetData + ]; + $backendModel->addData($data); + $this->checkSingleStoreMode($field, $backendModel); + + $path = $this->getFieldPath($field, $fieldId, $oldConfig, $extraOldGroups); + $backendModel->setPath($path)->setValue($fieldData['value']); + + $inherit = !empty($fieldData['inherit']); + if (isset($oldConfig[$path])) { + $backendModel->setConfigId($oldConfig[$path]['config_id']); + + /** + * Delete config data if inherit + */ + if (!$inherit) { + $saveTransaction->addObject($backendModel); + } else { + $deleteTransaction->addObject($backendModel); + } + } elseif (!$inherit) { + $backendModel->unsConfigId(); + $saveTransaction->addObject($backendModel); + } + } + } + } + + /** + * Get field object + * + * @param string $sectionId + * @param string $groupId + * @param string $fieldId + * @return Field + */ + private function getField(string $sectionId, string $groupId, string $fieldId): Field + { + /** @var Group $group */ + $group = $this->configStructure->getElement($sectionId . '/' . $groupId); + $fieldPath = $group->getPath() . '/' . $this->getOriginalFieldId($group, $fieldId); + $field = $this->configStructure->getElement($fieldPath); + + return $field; + } + + /** + * Map field name if they were cloned + * + * @param Group $group + * @param string $fieldId + * @return string + */ + private function getOriginalFieldId(Group $group, string $fieldId): string + { + if ($group->shouldCloneFields()) { + $cloneModel = $group->getCloneModel(); + + /** @var Field $field */ + foreach ($group->getChildren() as $field) { + foreach ($cloneModel->getPrefixes() as $prefix) { + if ($prefix['field'] . $field->getId() === $fieldId) { + $fieldId = $field->getId(); + break(2); + } + } + } + } + + return $fieldId; + } + + /** + * Set correct scope if isSingleStoreMode = true + * + * @param Field $fieldConfig + * @param ValueInterface $dataObject + * @return void + */ + protected function checkSingleStoreMode(Field $fieldConfig, $dataObject) + { + $isSingleStoreMode = $this->storeManager->isSingleStoreMode(); + if (!$isSingleStoreMode) { + return; + } + if (!$fieldConfig->showInDefault()) { + $websites = $this->storeManager->getWebsites(); + $singleStoreWebsite = array_shift($websites); + $dataObject->setScope('websites'); + $dataObject->setWebsiteCode($singleStoreWebsite->getCode()); + $dataObject->setScopeCode($singleStoreWebsite->getCode()); + $dataObject->setScopeId($singleStoreWebsite->getId()); + } + } + + /** + * Get field path + * + * @param Field $field + * @param string $fieldId Need for support of clone_field feature + * @param array $oldConfig Need for compatibility with _processGroup() + * @param array $extraOldGroups Need for compatibility with _processGroup() + * @return string + */ + private function getFieldPath(Field $field, string $fieldId, array &$oldConfig, array &$extraOldGroups): string + { + $path = $field->getGroupPath() . '/' . $fieldId; + + /** + * Look for custom defined field path + */ + $configPath = $field->getConfigPath(); + if ($configPath && strrpos($configPath, '/') > 0) { + // Extend old data with specified section group + $configGroupPath = substr($configPath, 0, strrpos($configPath, '/')); + if (!isset($extraOldGroups[$configGroupPath])) { + $oldConfig = $this->magentoConfig->extendConfig($configGroupPath, true, $oldConfig); + $extraOldGroups[$configGroupPath] = true; + } + $path = $configPath; + } + + return $path; + } + + /** + * Get scope name and scopeId + * + * @todo refactor to scope resolver + * @return void + */ + private function initScope() + { + if ($this->website === null) { + $this->website = ''; + } + if ($this->store === null) { + $this->store = ''; + } + + if ($this->store) { + $scope = 'stores'; + $store = $this->storeManager->getStore($this->store); + $scopeId = (int)$store->getId(); + $scopeCode = $store->getCode(); + } elseif ($this->website) { + $scope = 'websites'; + $website = $this->storeManager->getWebsite($this->website); + $scopeId = (int)$website->getId(); + $scopeCode = $website->getCode(); + } else { + $scope = 'default'; + $scopeId = 0; + $scopeCode = ''; + } + $this->scope = $scope; + $this->scopeId = $scopeId; + $this->scopeCode = $scopeCode; + } +} diff --git a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php index c5946c3..4295fe8 100644 --- a/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php +++ b/Plugin/Deploy/Package/Bundle/RequireJsPlugin.php @@ -1,35 +1,47 @@ scopeConfig = $scopeConfig; + /** + * mixed + */ + protected $allowedFiles; + + /** + * RequireJsPlugin constructor. + * @param Config $config + */ + public function __construct( + Config $config + ) { + $this->config = $config; } - public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, $sourcePath, $contentType) { + /** + * Improve bundling + */ + public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, $sourcePath, $contentType) + { + $jsOptimization = $this->config->isEnabled() && $this->config->isBundlingOptimizationEnabled(); - $jsOptimization = $this->scopeConfig->getValue('mfrocketjavascript/general/enable_javaScript_bundling_optimization', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); if ($jsOptimization) { - $includeInBundling = $this->scopeConfig->getValue('mfrocketjavascript/general/included_in_bundling', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); - $allowedFiles = str_replace("\r","\n", $includeInBundling); - $allowedFiles = explode("\n", $allowedFiles); - - foreach ($allowedFiles as $key => $allowedFile) { - $allowedFiles[$key] = trim($allowedFile); - if (empty($allowedFiles[$key])) { - unset($allowedFiles[$key]); - } - } - - foreach ($allowedFiles as $allowed) { - $allowedFiles[] = str_replace('.min.js', '.js', $allowed); - } + $allowedFiles = $this->getAllowedFiles(); $include = false; foreach ($allowedFiles as $allowedFile) { @@ -42,8 +54,36 @@ public function aroundAddFile(RequireJs $subject, callable $proceed, $filePath, if (!$include) { return true; } - } + return $proceed($filePath, $sourcePath, $contentType); } -} \ No newline at end of file + + public function getAllowedFiles() + { + if (null === $this->allowedFiles) { + $includeInBundling = $this->config->getIncludedInBundling(); + $allowedFiles = str_replace("\r", "\n", $includeInBundling); + $allowedFiles = explode("\n", $allowedFiles); + + foreach ($allowedFiles as $key => $allowedFile) { + $allowedFiles[$key] = trim($allowedFile); + if (empty($allowedFiles[$key])) { + unset($allowedFiles[$key]); + } + } + + foreach ($allowedFiles as $allowed) { + if (false !== strpos($allowed, '.min.js')) { + $allowedFiles[] = str_replace('.min.js', '.js', $allowed); + } else { + $allowedFiles[] = str_replace('.js', '.min.js', $allowed); + } + } + + $this->allowedFiles = $allowedFiles; + } + + return $this->allowedFiles; + } +} diff --git a/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php b/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php new file mode 100644 index 0000000..d4752fa --- /dev/null +++ b/Plugin/Frontend/Magento/Theme/Controller/Result/JsFooterPlugin.php @@ -0,0 +1,57 @@ +scopeConfig = $scopeConfig; + } + + /** + * @param \Magento\Theme\Controller\Result\JsFooterPlugin $subject + * @param \Closure $proceed + * @param Layout $argumentSubject + * @param Layout $result + * @param ResponseInterface $httpResponse + * @return Layout|mixed + */ + public function aroundAfterRenderResult( + \Magento\Theme\Controller\Result\JsFooterPlugin $subject, + \Closure $proceed, + Layout $argumentSubject, + Layout $result, + ResponseInterface $httpResponse + ) { + $jsRjOptimization = + $this->scopeConfig->isSetFlag(Config::XML_PATH_DEFERRED_ENABLED, ScopeInterface::SCOPE_STORE) && + $this->scopeConfig->isSetFlag(Config::XML_PATH_EXTENSION_ENABLED, ScopeInterface::SCOPE_STORE); + + return $jsRjOptimization + ? $result + : $proceed($argumentSubject, $result, $httpResponse); + } +} diff --git a/README.md b/README.md index 17eccf9..57864e1 100644 --- a/README.md +++ b/README.md @@ -1,34 +1,92 @@ -# [Magefan](http://magefan.com/) Rocket JavaScript Extension for Magento 2 +# [Magento 2 Rocket JavaScript Extension](https://magefan.com/rocket-javascript-deferred-javascript) by Magefan -Move all javascripts to the footer. -## Features - * Rocket JavaScript module allows you to move all javascript tags to the footer of the storefront page on your [Magento 2](http://magento.com/) Store. +[![Total Downloads](https://poser.pugx.org/magefan/module-rocketjavascript/downloads)](https://packagist.org/packages/magefan/module-rocketjavascript) +[![Latest Stable Version](https://poser.pugx.org/magefan/module-rocketjavascript/v/stable)](https://packagist.org/packages/magefan/module-rocketjavascript) + + + + + +## Magento2 Footer JavaScript +## Magento2 Deferred JavaScript +## Magento2 Optimized Bundle JavaScript + + + + ## Configuration * To enable or disable extension please navigate to Magento 2 Admin Panel > Stores > Magefan Extensions > Rocket JavaScript ## Requirements - * Magento Community Edition 2.1.x-2.2.x or Magento Enterprise Edition 2.1.x-2.2.x - -## Installation Method 1 - Installing via composer - * Open command line - * Using command "cd" navigate to your magento2 root directory - * Run command: composer require magefan/module-rocketjavascript + * Magento Community Edition 2.1.x-2.4.x or Magento Enterprise Edition 2.1.x-2.4.x + +## Installation +* [Install Rocket JavaScript Extension for Magento 2 via Composer or anarchive](https://magefan.com/blog/rocket-javascript-installation) - -## Installation Method 2 - Installing using archive - * Download [ZIP Archive](https://github.com/magefan/module-rocketjavascript/archive/master.zip) - * Extract files - * In your Magento 2 root directory create folder app/code/Magefan/Blog - * Copy files and folders from archive to that folder - * In command line, using "cd", navigate to your Magento 2 root directory - * Run commands: +## Get List Of Used JS On A Single Page ``` -php bin/magento setup:upgrade -php bin/magento setup:di:compile -php bin/magento setup:static-content:deploy +/* Use in browser console */ +globalSrc = ''; +jQuery('script').each(function(){ +if (!jQuery(this).attr('src')) return; +var src = jQuery(this).attr('src'); +if (src.indexOf(require.toUrl('')) != -1 && src.indexOf('Magefan_LazyLoad') == -1) { +var src = (src.replace(require.toUrl(''), '')); +globalSrc += "\n" + src; +} +}) +console.log(globalSrc); + ``` +## Demo + +Try out our open demo and if you like our extension **please give us some star on Github ★** + + + + + + + + + + + + + + + +
+ Storefront Demo + + Admin Panel Demo +
+ + Magneto 2 Rocket JavaScript Extension Storefront Demo + + + + Magento 2 Rocket JavaScript Extension Admin Panel Demo + +
+ + view + + + + view + +
## Support If you have any issues, please [contact us](mailto:support@magefan.com) @@ -38,18 +96,93 @@ then if you still need help, open a bug report in GitHub's Please do not use Magento Marketplace's Reviews or (especially) the Q&A for support. There isn't a way for us to reply to reviews and the Q&A moderation is very slow. -## Donate to us -All Magefan extension are absolutely free and licensed under the Open Software License version 3.0. We want to create more awesome features for you and bring up new releases as fast as we can. We hope for your support. -http://magefan.com/donate/ - ## License The code is licensed under [Open Software License ("OSL") v. 3.0](http://opensource.org/licenses/osl-3.0.php). -## Other Magefan Extensions That Can Be Installed Via Composer - * [Magento 2 Auto Currency Switcher Extension](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) - * [Magento 2 Blog Extension](https://magefan.com/magento2-blog-extension) - * [Magento 2 Login As Customer Extension](https://magefan.com/login-as-customer-magento-2-extension) - * [Magento 2 Conflict Detector Extension](https://magefan.com/magento2-conflict-detector) - * [Magento 2 Lazy Load Extension](https://github.com/magefan/module-lazyload) - * [Magento 2 Rocket JavaScript Extension](https://github.com/magefan/module-rocketjavascript) - * [Magento 2 CLI Extension](https://github.com/magefan/module-cli) +## [Magento 2 Extensions](https://magefan.com/magento-2-extensions) by Magefan + +### [Magento 2 Google Extensions](https://magefan.com/magento-2-extensions/google-extensions) + + * [Magento 2 Google Indexing](https://magefan.com/magento-2-google-indexing-api) + * [Magento 2 Google Analytics 4](https://magefan.com/magento-2-google-analytics-4) + * [Magento 2 Google Tag Manager](https://magefan.com/magento-2-google-tag-manager) + * [Magento 2 Google Shopping Feed](https://magefan.com/magento-2-google-shopping-feed-extension) + * [Magento 2 Google Customer Reviews](https://magefan.com/magento-2-google-customer-reviews) + +### Magento 2 SEO Extensions + + * [Magento 2 SEO Extension](https://magefan.com/magento-2-seo-extension) + * [Magento 2 Rich Snippets](https://magefan.com/magento-2-rich-snippets) + * [Magento 2 HTML Sitemap](https://magefan.com/magento-2-html-sitemap-extension) + * [Magento 2 XML Sitemap](https://magefan.com/magento-2-xml-sitemap-extension) + * [Magento 2 Facebook Open Graph](https://magefan.com/magento-2-open-graph-extension-og-tags) + * [Magento 2 Twitter Cards](https://magefan.com/magento-2-twitter-cards-extension) + + +### [Magento 2 Speed Optimization Extensions](https://magefan.com/magento-2-extensions/speed-optimization) + + * [Magento 2 Google Page Speed Optimizer](https://magefan.com/magento-2-google-page-speed-optimizer) + * [Magento 2 Full Page Cache Warmer](https://magefan.com/magento-2-full-page-cache-warmer) + * [Magento 2 Image Lazy Load](https://magefan.com/magento-2-image-lazy-load-extension) + * [Magento 2 WebP Images](https://magefan.com/magento-2-webp-optimized-images) + + ### [Magento 2 Admin Panel Extensions](https://magefan.com/magento-2-extensions/admin-extensions) + + * [Magento 2 Security Extension](https://magefan.com/magento-2-security-extension) + * [Magento 2 Admin Action Log](https://magefan.com/magento-2-admin-action-log) + * [Magento 2 Order Editor](https://magefan.com/magento-2-edit-order-extension) + * [Magento 2 Better Order Grid](https://magefan.com/magento-2-better-order-grid-extension) + * [Magento 2 Extended Product Grid](https://magefan.com/magento-2-product-grid-inline-editor) + * [Magento 2 Product Tabs](https://magefan.com/magento-2/extensions/product-tabs) + * [Magento 2 Facebook Pixel](https://magefan.com/magento-2-facebook-pixel-extension) + * [Magento 2 Email Attachments](https://magefan.com/magento-2-email-attachments) + * [Magento 2 Admin View](https://magefan.com/magento-2-admin-view-extension) + * [Magento 2 Admin Email Notifications](https://magefan.com/magento-2-admin-email-notifications) + * [Magento 2 Login As Customer](https://magefan.com/login-as-customer-magento-2-extension) + +### Magento 2 Blog Extensions + + * [Magento 2 Blog](https://magefan.com/magento2-blog-extension) + * [Magento 2 Multi Blog](https://magefan.com/magento-2-multi-blog-extension) + * [Magento 2 Product Widget](https://magefan.com/magento-2-product-widget) + +### [Magento 2 Marketing Automation Extensions](https://magefan.com/magento-2-extensions/marketing-automation) + + * [Magento 2 Cookie Consent](https://magefan.com/magento-2-cookie-consent) + * [Magento 2 Product Labels](https://magefan.com/magento-2-product-labels) + * [Magento 2 Base Price](https://magefan.com/magento-2-base-price) + * [Magento 2 Dynamic Categories](https://magefan.com/magento-2-dynamic-categories) + * [Magento 2 Dynamic Blocks and Pages Extension](https://magefan.com/magento-2-cms-display-rules-extension) + * [Magento 2 Automatic Related Products](https://magefan.com/magento-2-automatic-related-products) + * [Magento 2 Price History](https://magefan.com/magento-2-price-history) + * [Magento 2 Mautic Integration](https://magefan.com/magento-2-mautic-extension) + * [Magento 2 YouTube Video](https://magefan.com/magento2-youtube-extension) + +### [Magento 2 Cart Extensions](https://magefan.com/magento-2-extensions/cart-extensions) + + * [Magento 2 Checkout Extension](https://magefan.com/better-magento-2-checkout-extension) + * [Magento 2 Coupon Code](https://magefan.com/magento-2-coupon-code-link) + * [Magento 2 Guest to Customer](https://magefan.com/magento2-convert-guest-to-customer) + +### [Magento 2 Multi-Language Extensions](https://magefan.com/magento-2-extensions/multi-language-extensions) + + * [Magento 2 Hreflang Tags](https://magefan.com/magento2-alternate-hreflang-extension) + * [Magento 2 Auto Currency Switcher](https://magefan.com/magento-2-currency-switcher-auto-currency-by-country) + * [Magento 2 Auto Language Switcher](https://magefan.com/magento-2-auto-language-switcher) + * [Magento 2 GeoIP Store Switcher](https://magefan.com/magento-2-geoip-switcher-extension) + * [Magento 2 Translation](https://magefan.com/magento-2-translation-extension) + +### [Developers Tools](https://magefan.com/magento-2-extensions/developer-tools) + + * [Magento 2 Zero Downtime Deployment](https://magefan.com/blog/magento-2-zero-downtime-deployment) + * [Magento 2 Cron Schedule](https://magefan.com/magento-2-cron-schedule) + * [Magento 2 CLI Extension](https://magefan.com/magento2-cli-extension) + * [Magento 2 Conflict Detector](https://magefan.com/magento2-conflict-detector) + + ## [Shopify Apps](https://magefan.com/shopify/apps) by Magefan + + * [Shopify Login As Customer](https://apps.shopify.com/login-as-customer) + * [Shopify Blog](https://apps.shopify.com/magefan-blog) + * [Shopify Size Chart](https://magefan.com/shopify/apps/size-chart) + * [Shopify Google Indexer](https://magefan.com/shopify/apps/google-indexing) + * [Shopify Product Feeds](https://magefan.com/shopify/apps/product-feed) diff --git a/Setup/Patch/Schema/ChangePath.php b/Setup/Patch/Schema/ChangePath.php new file mode 100644 index 0000000..47b4d2a --- /dev/null +++ b/Setup/Patch/Schema/ChangePath.php @@ -0,0 +1,80 @@ +schemaSetup = $schemaSetup; + } + + /** + * {@inheritdoc} + */ + public function apply() + { + $this->schemaSetup->startSetup(); + $connection = $this->schemaSetup->getConnection(); + + $table = $this->schemaSetup->getTable('core_config_data'); + + $changedConfigurationFields = [ + 'mfrocketjavascript/general/enable_deferred_javascript' => 'mfrocketjavascript/deferred_javascript/enabled', + 'mfrocketjavascript/general/disallowed_pages_for_deferred_js' => 'mfrocketjavascript/deferred_javascript/disallowed_pages_for_deferred_js', + 'mfrocketjavascript/general/ignore_deferred_javascript_with' => 'mfrocketjavascript/deferred_javascript/ignore_deferred_javascript_with', + + 'mfrocketjavascript/general/enable_js_bundling_optimization' => 'mfrocketjavascript/javascript_bundling/enabled', + 'mfrocketjavascript/general/included_in_bundling' => 'mfrocketjavascript/javascript_bundling/included_in_bundling', + ]; + + foreach ($changedConfigurationFields as $oldPath => $newPath) { + $connection->update( + $table, + ['path' => $newPath], + ['path = ?' => $oldPath] + ); + } + + $this->schemaSetup->endSetup(); + } + + /** + * @return array + */ + public function getAliases() + { + return []; + } + + /** + * @return array + */ + public static function getDependencies() + { + return []; + } +} diff --git a/composer.json b/composer.json index d8af9c0..e7ad2d5 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,15 @@ { "name": "magefan/module-rocketjavascript", - "description": "Move all javascripts to the footer on Magento 2 store.", + "description": "Move all javascript to the footer on Magento 2 store.", + "require": { + "magefan/module-community" : ">=2.2.10" + }, + "suggest": { + "magefan/module-webp": "Install WebP Optimized Images to serve images in the next-gen format. Use coupon code COMPOSER-FAN to get 10% discount on magefan.com.", + "magefan/module-lazyload": "Install Lazy Load to defer offscreen images loading." + }, "type": "magento2-module", - "version": "2.0.0", - "license": "OSL-3.0", + "version": "2.2.2", "authors": [ { "name": "Magefan", @@ -18,4 +24,4 @@ "Magefan\\RocketJavaScript\\": "" } } -} \ No newline at end of file +} diff --git a/etc/acl.xml b/etc/acl.xml index 6543e05..8dc3afa 100644 --- a/etc/acl.xml +++ b/etc/acl.xml @@ -1,8 +1,8 @@ + + + + + diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index 04814d0..a462f1c 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -1,19 +1,16 @@ - - - -
- +
+ magefan Magefan_RocketJavaScript::config_magefan_rocketjavascript @@ -23,19 +20,69 @@ Magefan\RocketJavaScript\Block\Adminhtml\System\Config\Form\Info - + + Magento\Config\Model\Config\Source\Yesno + + + + Magefan\Community\Block\Adminhtml\System\Config\Form\ProductKeyField + + + + Magento\Config\Model\Config\Source\Yesno + Magefan\RocketJavaScript\Model\Config\Backend\DevSettings + + + + Magento\Config\Model\Config\Source\Yesno + Magefan\RocketJavaScript\Model\Config\Backend\DevSettings + Minification is not applied in developer mode. Static content deployment is a requirement after option change + + + + + + If enabled all JavaScript on storefront will be moved to the end of the page. Magento\Config\Model\Config\Source\Yesno - - + + + + 1 + + Enter page patches each in a new line. "*" means any path, you can use it at the beginning or end. + + + + + 1 + + data-rocketjavascript="false" will automatically be ignored. Example <script data-rocketjavascript="false">/* some script *</script>]]> + + + + + + + Magento\Config\Model\Config\Source\Yesno + Magefan\RocketJavaScript\Model\Config\Backend\DevSettings + Static content deployment is a requirement after option change + + + + + 1 + + Static content deployment is a requirement after option change Magento\Config\Model\Config\Source\Yesno - + - 1 + 1 + List of files that included in JS bundle.
diff --git a/etc/config.xml b/etc/config.xml index 181675f..6ccc965 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -2,7 +2,7 @@ - + + + + + diff --git a/registration.php b/registration.php index c6075b6..8a741fa 100644 --- a/registration.php +++ b/registration.php @@ -1,7 +1,7 @@