-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Adobe client data layer * Clean up * Update package description Co-authored-by: deloreyj <deloreyjmi@gmail.com> * Move definition to the effect * Don't parse acdl minified code * Include react as peerDep * Bump peregrine peerdep to a caret * Revert eb59d1c Revert to tilde. Release script doesn't handle carets well, and this isn't significant. Co-authored-by: deloreyj <deloreyjmi@gmail.com> Co-authored-by: Devagouda <40405790+dpatil-magento@users.noreply.github.com> Co-authored-by: Dev Patil <depatil@adobe.com>
- Loading branch information
1 parent
6ec0c58
commit ec4c86e
Showing
6 changed files
with
61 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
const { useEffect } = require('react'); | ||
|
||
module.exports = original => props => { | ||
useEffect(() => { | ||
// define the global as soon as possible | ||
globalThis.adobeDataLayer = globalThis.adobeDataLayer || []; | ||
|
||
// import the library as late as possible | ||
import(/* webpackChunkName: "acdl" */ | ||
/* webpackMode: "lazy" */ | ||
/* webpackPrefetch: true */ | ||
'@adobe/adobe-client-data-layer'); | ||
}, []); | ||
|
||
return original(props); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = targets => { | ||
const { talons } = targets.of('@magento/peregrine'); | ||
|
||
talons.tap(({ App }) => { | ||
App.useApp.wrapWith('@magento/venia-adobe-data-layer'); | ||
}); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"name": "@magento/venia-adobe-data-layer", | ||
"version": "0.0.1", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"description": "Provides Adobe Client Data Layer support in PWA Studio", | ||
"main": "./index.js", | ||
"scripts": { | ||
"clean": " " | ||
}, | ||
"repository": "github:magento/pwa-studio", | ||
"license": "(OSL-3.0 OR AFL-3.0)", | ||
"dependencies": { | ||
"@adobe/adobe-client-data-layer": "~1.1.3" | ||
}, | ||
"peerDependencies": { | ||
"@magento/peregrine": "~8.0.0", | ||
"react": "~16.9.0" | ||
}, | ||
"pwa-studio": { | ||
"targets": { | ||
"intercept": "./intercept" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters