@truex/truex-html5-tar v1.0.0
TruexAdRenderer-HTML5 (HTML5 TAR)
Here is the full documentation on how to get up and running with the HTML5 TruexAdRenderer (TAR).
HTML5 TAR Workflow
Dependencies
Yarn: npm install -g yarn
After installing Yarn:
yarn install
HTML5 TAR Development
npm start
This will launch the Webpack Dev Server @ localhost:8080 that you will be using to develop against.
HTML5 TAR Production Build
npm run prod
This will create the production build. The difference between the dev build and the production build is that the production build uses additional plugins for optimization such as UglifyJS as well as stripping out unneeded webpack specific code.
For more information, look at webpack.prod.js
.
HTML5 TAR Testing
We use Jest for our unit testing. Jest gives us BDD style syntax for writing tests as well as a tooling to support continuous testing and coverage reports.
Running Tests
npm test
Continuous Testing
To have tests run automatically while you develop:
npm run watch
Container 3 Development Workflow for HTML5 CTV
Setup
- Clone the
container_core
repo. - Complete the Setup as documented in its
README.md
file (yarn install
, basically). - Get the
ad_vars
from a working Container 3 ad, as an example, here's how to get thead_vars
from the Kung Fu Panda Container 3 ad:- Get the
window_url
for the ad by navigating to http://qa-get.truex.com/81551ffa2b851abc5372ab9ed9f1f58adabe5203/vast/config?network_user_id=test_html5_00002. Thewindow_url
can be found in the top levelads
object that's returned. - Navigate to that
window_url
in Chrome (note). Ensure your ad blocker is disabled. You should see the ad render at this point. - Open up the Chrome Dev Tools, and click on the Network tab.
- Refresh the page so that all transactions are visible.
- Still from the Network tab, filter transactions by typing
json
in the search field at the top. This should filter down the list to theengage.json
call. - Click on that call. The
ad_vars
is the displayed JSON blob.
- Get the
- Copy the
ad_vars
into thesrc/pwamp/src/txm_params/_desktop_ad_vars.js
file, replacing the existingdesktopAdVars
payload. - Run
npm start
to build Container 3 and run the local web server.
Development and Testing
- Navigate to
localhost:8080/desktop.html
, the Kung Fu Panda ad configured in Setup should render, but this time based on your local Container 3 code base. - You're now able to make changes to the code base, which are reloaded on the fly.
Choice Card Development Workflow
Setup
- Clone the
integration_core
repo. - Complete the Setup as documented in its
README.md
file (brew install grunt
,npm install
). - Start the
integration_core
dev server:grunt server
. - Verify that the dev server is up and can serve up the Choice Card JS by browsing to:
http://localhost:8001/fw_renderers/choicecard-tv-tar.js
. - Back in the current repo (
TruexAdRenderer-HTML5
), editsrc/desktop/desktop.js
to load your local version of the Choice Card by changing the URL loaded bygetScript
tohttp://localhost:8001/fw_renderers/choicecard-tv-tar.js
. - Run
npm start
to build theTruexAdRenderer-HTML5
repo and run the local web server.
Development and Testing
- Navigate to
localhost:8080/desktop.html
, the Choice Card should render, but this time based on your localintegration_core
code base. - You're now able to make changes to the
choicecard-tv-tar.js
code base, which are reloaded on the fly. - The
TruexAdRenderer-HTML5
includes a hard codedvast_config
which includes the Choice Card configuration. This can be found insrc/hulu_ctv/tx_initialize_hulu_ctv.js
. Edit this file to test changes to the card configuration.
4 years ago