|
| 1 | +# 2.0.0-beta.1 (GA candidate) |
| 2 | + |
| 3 | +## Breaking |
| 4 | + |
| 5 | +- DOMContentLoaded handler is now opt-in instead of the default behavior |
| 6 | + - Reasons: |
| 7 | + - The primary use case will be using the core library within another library which may not have the DOM ready even if DOMContentLoaded has fired. |
| 8 | + - Most developers using SPA applications will fetch embed data asynchronously and not know report data by the time the DOMContentLoaded has fired. |
| 9 | + - How to opt-in to DOMContentLoaded: |
| 10 | + - Call `enableAutoEmbed()` on an instance of the PowerBi service to add the event listener. |
| 11 | + |
| 12 | + Example: |
| 13 | + ``` |
| 14 | + <script src="powerbi.js"></script> |
| 15 | + <script> |
| 16 | + powerbi.enableAutoEmbed(); |
| 17 | + </script> |
| 18 | + ``` |
| 19 | + |
| 20 | + Alternately if you are creating an instance of the service you can pass a configuration parameter `autoEmbedOnContentLoaded` |
| 21 | + |
| 22 | + Example: |
| 23 | + ``` |
| 24 | + var powerbiService = new Powerbi({ autoEmbedOnContentLoaded: true }); |
| 25 | + ``` |
| 26 | +- `powerbi.get(element: HTMLElement)` is removed. Use `powerbi.embed(element: HTMLElement, config: IEmbedOptions = {})`. |
| 27 | + - Reasons: |
| 28 | + - powerbi.embed performed the same function and is more semantic. |
| 29 | +- Embed urls must be provided by the server and will not be constructed by the components. This implies that the attributes `powerbi-report` will no longer be used. |
| 30 | + - Reasons: |
| 31 | + |
| 32 | + The construction of these urls was unreliable since it dependeded on assumptions about server configuration (target environment, component type, etc). |
| 33 | + Since url would be incorrect in some cases it could cause trouble for developers. Also, since the sever is already returning access tokens it's trival for the server to also provide embed urls and this reduces complexity. |
| 34 | + |
| 35 | + Previously you could supply the embed information in two ways: |
| 36 | + |
| 37 | + 1. Using report id: |
| 38 | + |
| 39 | + `<div powerbi-embed powerbi-report="5dac7a4a-4452-46b3-99f6-a25915e0fe55" powerbi-access-token="..."></div>` |
| 40 | + |
| 41 | + This would implicitly construct the embed url to be something like: `https://embedded.powerbi.com/reports/5dac7a4a-4452-46b3-99f6-a25915e0fe55` |
| 42 | + However |
| 43 | + |
| 44 | + 2. Using embed url: |
| 45 | + |
| 46 | + `<div powerbi-embed-url="https://embedded.powerbi.com/reports/5dac7a4a-4452-46b3-99f6-a25915e0fe55" powerbi-access-token="..."></div>` |
| 47 | + |
| 48 | + Now only the latter options (#2) is supported. |
| 49 | + |
| 50 | +- Embed url attribute changed from `powerbi-embed` to `powerbi-embed-url` |
| 51 | +- Component type is specified by attribute `powerbi-type`. Use `powerbi-type="report"` instead of applying the attribute `powerbi-report` |
| 52 | +- Configuration option attributes all start with prefix `powerbi-options-`. Example (`powerbi-options-filter`) |
| 53 | +
|
| 54 | +## Changes |
| 55 | +
|
| 56 | +- Fix bug to prevent memory leak of holding references to iframe elements which had been removed from the DOM. |
| 57 | +- Detect overwriting container with new component and either throw error or properly cleanup and replace old component based on `config.overwrite` setting. |
| 58 | +- Fix bug with prematurely attempting to parse post message data until it is known that it originated from embedded iframe. |
| 59 | + |
| 60 | +# 1.0.0 (Preview) |
0 commit comments