Skip to content

Commit

Permalink
Merge pull request #13 from rostilos/develop
Browse files Browse the repository at this point in the history
v2.1.0 release
  • Loading branch information
rostilos authored Jan 11, 2025
2 parents 758ca7c + ee367ef commit 6da2cfc
Show file tree
Hide file tree
Showing 24 changed files with 1,085 additions and 566 deletions.
39 changes: 25 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Traditional connection / with Partytown module:
</p>

![diff](https://github.com/rostilos/perspective-partytown/assets/85498741/cae5b261-8992-4ef9-9761-61a149b1c5fb)
![Screenshot_20250111_073736](https://github.com/user-attachments/assets/16f8e67e-685f-4eb2-897e-725f2158a8f4)



<h2>Requirements: </h2>
Expand All @@ -22,23 +24,25 @@ Traditional connection / with Partytown module:

<h2>Installing the module</h2>

<ol>
<li>composer config repositories.perspective-magento2-partytown git [email protected]:rostilos/perspective-partytown.git</li>
<li>composer require perspective/magento2-partytown dev-master</li>
<li>php bin/magento setup:upgrade</li>
<li>bin/magento setup:di:compile</li>
<li>php bin/magento setup:static-content:deploy</li>
<li>Clear all Cache</li>
</ol>

```
composer config repositories.perspective-magento2-partytown git [email protected]:rostilos/perspective-partytown.git
composer require perspective/magento2-partytown dev-master
php bin/magento setup:upgrade
bin/magento setup:di:compile
php bin/magento setup:static-content:deploy
php bin/magento cache:clean
php bin/magento cache:flush
```

<h2>Updating partytown npm packages </h2>
<p>The library files provided by the npm package @builder.io/partytown are already added to the module files, but in case you want to update them, it is recommended to do the following :</p>

<ol>
<li>cd _magento-root_/vendor/perspective/magento2-partytown</li>
<li>npm install ( node v16+ required )</li>
<li>npm run partytown</li>
</ol>
```
cd <project-root>/vendor/perspective/magento2-partytown
npm install ( node v16+ required )
npm run partytown
```

<p>Note that if you update the composer package, or reinstall it, you will revert to the existing version in the repository. This is planned to be fixed in future updates</p>

Expand All @@ -64,7 +68,7 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=

<h2>For correct work it is recommended to specify url to reverse proxy</h2>

<a href="https://github.com/rostilos/perspective-partytown/blob/2.0.0-alpha/docs/reverse-proxy.md">Example of a self-hosted implementation using nodejs </a>
<a href="https://github.com/rostilos/perspective-partytown/blob/master/docs/reverse-proxy-nodejs.md">Example of a self-hosted implementation using nodejs </a>

<a href="https://github.com/rostilos/perspective-partytown/blob/master/docs/reverse-proxy-nginx.md">Example of a self-hosted implementation using warden and custom container for revense-proxy ( nginx based ) </a>

Expand All @@ -74,3 +78,10 @@ j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
<p>Cloudflare Workers can be used as a reverse proxy ( more for testing purposes or for sites with low traffic due to Cloudflare limitations ) proxied with Cloudflare </p>

![cb2ad081-f2de-4200-8421-938213900f29](https://github.com/rostilos/perspective-partytown/assets/85498741/b661604c-392e-4e0e-a98b-54fb776c7e92)

<h2>Potential drawbacks</h2>
<ol>
<li>The difficulty is in further debugging the dataLayer. Because when using the module, it will not be stored in window context, and many browser extensions will not work correctly</li>
<li>Need to configure reverse proxy</li>
<li>Modifications of third-party modules for ga4 analytics ( problems with some modules were observed )</li>
</ol>
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"name": "perspective/magento2-partytown",
"description": "Module for integrating BuilderIO/partytown library functionality into Magento 2 project",
"type": "magento2-module",
"version": "2.0.4",
"version": "2.1.0",
"license": [
"OSL-3.0",
"AFL-3.0"
],
"require": {
"php": "~8.1.0||~8.2.0",
"php": ">=8.1",
"magento/framework": "*"
},
"autoload": {
Expand Down
2 changes: 1 addition & 1 deletion docs/reverse-proxy-nodejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ref. <a href="https://partytown.builder.io/proxying-requests">From Docs</a>
<li>cd samples/nodejs-reverse-proxy</li>
<li>npm install ( node v16+ )</li>
<li>node server.js</li>
<li>Next, the nodejs server will start, the default url is http://127.0.0.1:3000.</li>
<li>Next, the nodejs server will start, the default url is http://127.0.0.1:3000/proxy.</li>
</ul>

<p>Configuration via M2 admin panel</p>
Expand Down
16 changes: 8 additions & 8 deletions src/Api/Config/ConfigProviderInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ interface ConfigProviderInterface
public function isModuleEnabled(): bool;

/**
* @return mixed
* @return null|string
*/
public function getLoadViaMainThreadList(): mixed;
public function getLoadViaMainThreadList(): ?string;

/**
* @return bool
Expand All @@ -40,9 +40,9 @@ public function isDebugEnabled(): bool;


/**
* @return mixed
* @return string
*/
public function getForwardingEventsList(): mixed;
public function getForwardingEventsList(): string;


/**
Expand All @@ -52,19 +52,19 @@ public function isProxyingRequestsEnabled(): bool;


/**
* @return mixed
* @return string
*/
public function getProxyingRequestList(): mixed;
public function getProxyingRequestList(): string;


/**
* @return string|null
* @return null|string
*/
public function getProxyUrl(): ?string;

/**
* @return mixed
*/
public function getDebugConfigsList(): mixed;
public function getDebugConfigsList(): string;

}
159 changes: 0 additions & 159 deletions src/Block/Config.php

This file was deleted.

7 changes: 5 additions & 2 deletions src/Model/Adminhtml/System/Config/ForwardingMultiselect.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php

declare(strict_types=1);

namespace Perspective\Partytown\Model\Adminhtml\System\Config;

use function Perspective\Partytown\Model\Adminhtml\System\Config;
use Perspective\Partytown\Model\Adminhtml\System\Config;
use Magento\Framework\Option\ArrayInterface;

class ForwardingMultiselect implements \Magento\Framework\Option\ArrayInterface
class ForwardingMultiselect implements ArrayInterface
{

public function toOptionArray(): array
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
<?php


declare(strict_types=1);

namespace Perspective\Partytown\Model\Adminhtml\System\Config;

use function Perspective\Partytown\Model\Adminhtml\System\Config;
use Perspective\Partytown\Model\Adminhtml\System\Config;
use Magento\Framework\Option\ArrayInterface;

class LogConfigMustiselect implements \Magento\Framework\Option\ArrayInterface
class LogConfigMultiselect implements ArrayInterface
{

public function toOptionArray(): array
{
return [
Expand Down
Loading

0 comments on commit 6da2cfc

Please sign in to comment.