This component serves as communication layer between parent and child frames. Gateway supports cross and same origin communication between frames on same page.
Our packages are published to GitHub Packages. You need to add the entry to global or project based .npmrc
file so that all requests to install our packages will go through GitHub Packages.
@nsftx:registry=https://npm.pkg.github.com
After that, install package
npm install @nsftx/seven-gravity-gateway --save
GG consists of 2 modules: Master and Slave module. Master module is intended for frames which will integrate 3rd party product via iframe. Slave module is intended for applications which will be integrated in some 3rd party frame.
Modules are exposed as UMD modules which we can be required as CommonJS or AMD modules, or simply injecting the script in HTML and using the global reference.
Master gateway:
var Gateway = window.gravity.gateway.master;
or
import Gateway from '@nsftx/seven-gravity-gateway/master';
Slave gateway:
var Gateway = window.gravity.gateway.slave;
or
import Gateway from '@nsftx/seven-gravity-gateway/slave';
To load both modules:
import Gateway from '@nsftx/seven-gravity-gateway';
For a detailed explanation about how GG works, check Wiki.
npm run test
or npm run test:watch
Any contributions you make are greatly appreciated.
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request against
next
- Once approved, Open a new Pull Request against
master
In order to release next version of the library pull request is required. Use following steps for release.
- Merge approved pull requests that should be in next version to
master
ornext
- Create
version-$nextVersion
branch from master or next - run
npm version $versionType
for stable release or for nextnpm version prerelease --preid=beta
- Push branch & tag to remote
- Create pull request using
release
template https://github.com/nsftx/seven-components/pull/new?template=release.md - After pull request is merged create a new Release document https://github.com/nsftx/seven-components/releases/new. GitHub will trigger action (
.github/workflows/release.yml
) and it will publish package