Conversation
- add multi-instances support with backward compatibility for standard api (ios); - new js modules cordova.InAppBrowserMulti; - update package information; - update plugin information; - update readme;
- add multi-instances support with backward compatibility for standard api (android); - fix executeScript and insertCSS in js modules cordova.InAppBrowserMulti; - update package information; - update plugin information;
- small cosmetic adjustments in ios and android sources; - add types definition for js module cordova.InAppBrowserMulti; - add eslint configs for tests; - add unit tests with jest; - add types checks with tsd; - update package information;
- update package-lock.json
- correct dependencies in package-lock.json
- correct dependencies in package-lock.json
breautek
left a comment
There was a problem hiding this comment.
My review is limited to the meta details on the repository, rather than a code review.
Overview is that version or engine details shouldn't be changing as part of this PR. If there are breaking changes that warrants a 7.x then the breaking changes should be noted in this PR description and updating the vesion to 7.0.0-dev should be done with it's own standalone PR. This is to protect ourselves from merging in other breaking changes and then having to rollback this PR for whatever reason, the major version and engine bumps will stay.
For unit testing, Cordova uses paramedic tool that is responsible for running the tests in a cordova webview environment. So introducing jest probably won't fly. Internally paramedic uses jasmine test runner so any test written may need to be refactored.
Introducing tsd may be ok as it expands coverage against something we historically don't really ever test.
I didn't spend much time looking at the actual code, but I'll note that the plugin already supports holding different IAB references and communicating with those references and by extension should already support maintaining multiple instances of IAB windows. Introducing an entire new InAppBrowserMulti API is a bit of a red flag for me.
If something is not working as expected there, perhaps that warrants a discussion.
| "devDependencies": { | ||
| "@cordova/eslint-config": "^5.0.0" | ||
| "@cordova/eslint-config": "^5.0.0", | ||
| "jest": "^30.2.0", |
There was a problem hiding this comment.
unit tests should be ran via cordova's paramedic tool which uses jasmine behind-the-scenes. See the existing tests.
There was a problem hiding this comment.
I've never worked with that, but I'll try to figure out if make sense to keep new tests or remove. Thank you for the hint.
- versions and engines in package.json and plugin.xml
|
If that's the case, then we can probably update the native side to retain references of IAB instances, and assign them IDs so that we can map calls back onto them. |
basically it is what was done with CDVInAppBrowserWindowManager (ios) / InAppBrowserWindowManager (android). To hold the instances, assign unique windowId, and send events to correct browser instance. Seems like there were also issues reported + some discussions on stackoverflow: Let me first harmonise InAppBrowser and InAppBrowserMulti or prove that they should stay separate + make unit test to work via cordova-paramedic or remove them. And I'll back to MR. |
Platforms affected
ios, android
Motivation and Context
Description
Add multi-instance support:
Testing