Repository navigation
feat(device): publish a NativeScript build as @ably/pubsub-device/nativescript - #2342
Conversation
|
No actionable comments were generated in the recent review. WalkthroughThe NativeScript device bundle now uses a dedicated webpack target and is published through the ChangesNativeScript device bundle
Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant Grunt
participant Webpack
participant DevicePackage
participant ReleaseCheck
Grunt->>Webpack: Run webpack:nativeScript
Webpack->>DevicePackage: Write dist/nativescript.js
DevicePackage->>DevicePackage: Resolve the ./nativescript export
ReleaseCheck->>DevicePackage: Require dist/nativescript.js
Possibly related PRs
Suggested reviewers: Merge Risk:
|
…ivescript Since the package split, the NativeScript bundle was still built, but only into the private packages/core-impl/build/, so no published package carried it. Build it from the device package's entry point into packages/device/dist/nativescript.js instead, and publish it behind the documented `./nativescript` subpath rather than an export condition. The bundle reaches the NativeScript implementation through a new `nativescript` condition on the private `@ably/pubsub-core-impl/platform`, read only when bundling. It keeps every log, as there is no debug counterpart, and includes MessagePack, as the NativeScript bundle always has, rather than leaving it to the `MsgPack` plugin. `nativescript-websockets` and `@nativescript/core` stay external, provided by the app. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39bedcb to
762a687
Compare
Since the package split, the NativeScript bundle has still been built but in private build folder. No published package carries it, so NativeScript apps have no way to install the SDK. Up to
ably2.30.0 the file shipped in the tarball underbuild/**.This PR publishes a NativeScript build from
@ably/pubsub-device, under a documented subpath:Why a subpath and not an export condition
With a subpath, the app opts in through its import path, so the package doesn't depend on which conditions NativeScript's bundler sets.
./nativescriptresolves to the bundle under every condition:How it's built
webpack.config.jsreplaces the old standaloneably-nativescript.jsUMD config withcreateNativeScriptConfig(), modelled on the React Native bundle. It bundlespackages/device/src/index.tsintopackages/device/dist/nativescript.jsas CommonJS, andbuild:packagesruns it via a newwebpack:nativeScripttask.@ably/pubsub-core-impl/platformgains anativescriptcondition. It is only read at bundle time, so no published package exposes it.nativescript-websocketsand@nativescript/core/application-settingsstay external.Summary by CodeRabbit
New Features
Documentation