Modules
Starting with Version 1.3 of BidJS, we have begun to migrate to a modular codebase. This means that you can define which parts of BidJS you want to load and use, among other benefits outlined below.
During this migration phase, there will be some duplication / extra scripts required on your website. As this progresses, and modules replace an increasing amount of the BidJS application, this duplication will disappear.
The modules give various benefits, including:
- Supporting both Bootstrap 3 and Bootstrap 4
- Optionally being able to include any number of modules on a completely independent page to the main BidJS application
- Ability to use HTML5 PushState (e.g. "/auctionDetails") instead of Hashbang URLs (e.g. "#!/auctionDetails")
- No conflicts with other scripts (jQuery etc)
- Lazy-loads each module as used, so customers don't need to download the entire application at first load
- Far better performance
Implementation:
Before the end of the <head>
tag:
<script> window.bidjs = { config: { apiBase: 'MY_API_BASE_ENDPOINT', // e.g. demo.eu-west-2.bidjs.com/auction-007/api clientId: 'MY_CLIENT_ID', // e.g. demonstration googleMapsApiKey: 'YOUR_KEY' // currently only required for MySales staticBase: 'MY_STATIC_URL/VERSION', // e.g. demo.eu-west-2.bidjs.com/static/1.3 staticCDN: 'https://static.bidjs.com', // Do not change staticVersion: 'MY_STATIC_VERSION', // e.g. 1.0 templateVariant: 'bootstrap3' // either 'bootstrap3' or 'bootstrap4' }, modules: { auctionDetails: '#!/auctionDetails/%AUCTION_ID%', auctionsArchived: true, mySales: true }, options: {}} </script>
Please note: Input formatting for this config section follows different rules to other areas of the BidJS code. Please see the notes next to each line of config for specific details
Where you want your module to display, within the <body>
tags:
<div class="container bidlogix-app"> <div id="bidjs"></div> </div>
At the end of your <body>
tag:
<script src="https://static.bidjs.com/MY_STATIC_VERSION/bootstrap3/js/bidjs-modules.chunk.js"></script>
Versioning
Please note that BidJS and BidJS Modules are versioned independently.
The version for one is not the same as the version for the other. Please reference the Upgrade Notes for which version of BidJS Modules should be used alongside which version of BidJS
Configuration Options
Modules
As parts of BidJS are migrated to modules, the list of modules here will grow. Each module has 3 possible values:
- true - the module should be loaded on this page, in the modules container when the URL matches the module name
- false - the module is disabled, and any links / references to this module should not display
- "url" - the location where this module is hosted. If on the same page in the traditional BidJS application, this should be the "hashbang" URL. If on another page, it should be the address of the relevant page.
See the list of Current Modules below, as reference. This list will expand as more pages are migrated to modules.
Current Modules
Key | Name | Description |
---|---|---|
auctionsArchived | Archived Auctions | Displays a searchable list of all archived auctions for all your auctioneers |
mySales | My Sales | Displays a history of sales per auction to your lot vendors |
Options
Key | Description | Required | Default | Version |
---|---|---|---|---|
analyticsCode | The Google Analytics UA tracking code on which you wish for BidJS pageviews to be recorded | false | 1.1+ | |
analyticsNamespace | If your Google Analytics has already been initialised on your parent website and it has a specific namespace, you can specify that here to prevent conflicts. This is unlikely to be required in most situations. | false | 1.1+ | |
defaultModule | The name of the module to be loaded at the "base url" of the current page. If using modules on a page with the main BidJS application, then this is likely to be "empty". If you are using modules on an independent page, you can specify which the default should be, e.g. "auctionsArchived" | false | "empty" | |
standalone | Defines whether BidJS Modules are on their own page, i.e. "true", or whether they are featured on a page where BidJS is already embedded, i.e. "false". | false | false | 1.0+ |
urlPattern | Should be either "hash" or "pushState". Using "hash" will cause your module URLs to look like www.yourwebsite.com/yourpage#!/moduleKey Using "pushState" will cause your module URLs to look like www.yourwebsite.com/yourpage/moduleKey | false | "hash" | |
unsupportedBrowserMessage | Will display an alert to users of Internet Explorer 11 and below with this content. This should only be used if Modules are used on a separate page to BidJS, as BidJS will already display a message. | false | 1.0+ |
Modules Versions (out of date)
Version Number | Release date | Currently supported | Version Update |
---|---|---|---|
1.3 | (TBC) | Yes | Adds MySales Lot List view |
1.2 | 03-06-19 | Yes | Adds custom Google Analytics tracking support |
1.1 | 03-05-19 | Yes | Adds MySales details module |
1.0 | 12-04-19 | Yes |
|
0.1 | 09-11-18 | No | (Modules v0.1) This implements the first BidJS Module, a new concept which is covered in detail within the Technical Documentation The module implemented is: Archived Auctions No change is necessary for clients unless they implement this or future modules, in which case the documentation should be followed. |