cf-workers-native 0.1.3-beta.pr68.sha6899b03e59cc → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +65 -41
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -4,25 +4,45 @@
4
4
 
5
5
  Reach people who prefer the browser and people who look for apps in the store. Offer a mobile app alongside your web app, so your users can choose the platform that works for them.
6
6
 
7
- ## Choose how to bring your app to mobile
7
+ ## Your web app can have a mobile version
8
8
 
9
- - **Embed in an existing iOS app**
10
- Add a Workers-powered screen to your UIKit or SwiftUI app. [iOS guide](docs/native-embedding.md#ios).
11
- - **Embed in an existing Android app**
12
- Add a Workers-powered screen to your existing Android app. [Android guide](docs/native-embedding.md#android).
13
- - **Create a new mobile app**
14
- Use Capacitor to build an iOS and Android app for distribution through the App Store and Google Play. [Capacitor guide](docs/integration.md).
9
+ If you have a web app running on Cloudflare Workers, you can add an iOS and Android
10
+ app built around its existing pages and backend. For example, a Void app with
11
+ D1-backed forms can keep its loaders, actions and database on Workers while the
12
+ mobile app displays its pages and bundles its public JavaScript and CSS.
15
13
 
16
- [Documentation](docs/README.md) · [Examples](demo/README.md)
14
+ cf-workers-native connects your Workers application to a mobile app built with
15
+ Capacitor. Capacitor supplies the iOS and Android projects and access to native
16
+ plugins. You add a separate mobile build and test your application's flows; you
17
+ keep developing and deploying your web app to Cloudflare.
17
18
 
18
- ## Keep building the app you know
19
+ **Start here: [Add a mobile version to your existing app](docs/integration.md).**
20
+ You do not need an existing native app. The guide takes you from choosing your
21
+ Worker entry to running your pages on a simulator or emulator.
19
22
 
20
- - **Reuse your pages and flows.** Bring Worker-rendered HTML, links and forms into a mobile WebView. Keep the application's existing rendering model; an SPA rewrite is not a prerequisite.
21
- - **Give your app a mobile home.** Create an iOS and Android app with Capacitor, or bring your Workers pages into a native app you already have.
22
- - **Keep your backend on Workers.** D1, server secrets and cloud-dependent logic stay on the deployed Worker. The separate mobile build leaves your Cloudflare deployment inputs unchanged.
23
- - **Choose what runs on the device.** Start with the default network execution. Where supported, explicitly select public routes for local execution and bundle client assets with the app.
23
+ ## See an example close to your app
24
24
 
25
- Local execution has [compatibility limits](docs/compatibility.md). Cloud-backed pages still need a connection; bundling their client assets does not make them offline applications.
25
+ | What you have | What to try | What the example demonstrates |
26
+ | --------------------------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------- |
27
+ | HTML pages served by a Worker | [Hono / Express pages](demo/rendering/README.md) | Page navigation, forms and redirects inside a mobile app. |
28
+ | A Void React Pages app using D1 | [Void + D1 sample](demo/void/README.md) | Server-rendered pages, React interaction and a form that writes to D1. |
29
+ | A Next.js app deployed through OpenNext | [OpenNext sample](demo/opennext/README.md) | Connecting generated pages and assets to a mobile build; see its version and feature limits. |
30
+
31
+ These are examples and test fixtures, not customer deployment stories. Each guide
32
+ states what has been verified. Start with the flow closest to yours, then try it
33
+ with your own app.
34
+
35
+ ## What stays, what you add
36
+
37
+ - **Keep your pages and backend.** Reuse supported HTML, links, forms and client interactions. D1, server secrets and cloud-dependent logic stay on Workers.
38
+ - **Add a mobile build.** Connect your Worker and public assets to a Capacitor app with its own name and application ID.
39
+ - **Check the mobile experience.** Verify login, navigation, data changes, reopening and connection recovery in your application.
40
+ - **Prepare for distribution.** Configure signing and store information through the native application workflow. Store submission and review remain separate steps.
41
+
42
+ Start with requests running on your existing deployed Worker. Cloud-backed pages
43
+ need a connection. Bundled client assets do not make them offline applications.
44
+ Optional local execution is covered by the [execution guide](docs/cloudflare-bindings.md#choosing-execution)
45
+ and [compatibility limits](docs/compatibility.md).
26
46
 
27
47
  ## Start from your framework
28
48
 
@@ -35,47 +55,51 @@ Local execution has [compatibility limits](docs/compatibility.md). Cloud-backed
35
55
 
36
56
  Each guide describes its tested versions and boundaries. Already have a separate frontend calling Worker APIs? Keep that frontend and use the [Fetch-only integration](docs/runtime.md#fetch-only-integration).
37
57
 
38
- ## Get your app onto your phone
58
+ ## Try it with your app
39
59
 
40
- Install the shared JavaScript package in your web project:
60
+ You need the application's source, its Worker build and a test Worker URL for
61
+ cloud-backed flows. Running iOS requires macOS and Xcode; Android requires the
62
+ Android development tools. The [setup guide](docs/integration.md#before-you-start)
63
+ links the platform prerequisites.
41
64
 
42
- The `latest` npm tag includes 0.x Preview releases. Install this release explicitly:
65
+ Install the package in your web project, then follow the
66
+ [complete mobile setup](docs/integration.md#workflow):
43
67
 
44
68
  ```sh
45
- npm install --save-exact cf-workers-native@0.1.3
46
- ```
47
-
48
- The mobile entry selects the host. For example, an iOS web entry starts with:
49
-
50
- ```ts
51
- import { workersIOS } from "cf-workers-native/ios";
52
-
53
- const app = workersIOS({
54
- baseURL: "https://your-worker.example.com/",
55
- render: "/",
56
- });
57
- await app.ready;
69
+ npm install --save-exact cf-workers-native@0.1.4
58
70
  ```
59
71
 
60
- Use `workersAndroid` from `cf-workers-native/android` or `workersCapacitor` from `cf-workers-native/capacitor` for the other hosts. All three share the same runtime options and [Vite/esbuild tooling](docs/build-setup.md).
61
-
62
- This entry is one part of the setup: connect the existing Worker to a **separate mobile build**, then package its output with your chosen native host. The [embedding guide](docs/native-embedding.md) and [Capacitor guide](docs/integration.md) cover the complete path. For an existing native app, build the web assets in the web project or CI; the native project does not need Capacitor CLI commands or configuration.
72
+ Installation alone does not generate a mobile project. The guide covers adding
73
+ Capacitor, configuring the mobile build, and running it on iOS or Android. Your
74
+ first milestone is one existing page, a link to another page, and a working form
75
+ or data action on a simulator or emulator.
63
76
 
64
- **All 0.x releases are Preview releases.** APIs may change. Android embedding requires WebView `MULTI_PROFILE` support. The native Android SDK is available from Maven Central at version `0.1.2`. Read the [native requirements](docs/native-embedding.md#dependency-setup) before integrating. Upgrading from `workers-capacitor`? Follow the [migration steps](docs/integration.md#migrating-from-the-old-npm-package).
77
+ **All 0.x releases are Preview releases**, including those on npm's `latest` tag.
78
+ APIs may change. Use your app's actual flows to evaluate the fit before distribution.
79
+ Upgrading from `workers-capacitor`? Follow the [migration steps](docs/integration.md#migrating-from-the-old-npm-package).
65
80
 
66
81
  ## Build with your AI assistant
67
82
 
68
- Open your application repository and give your assistant this prompt, replacing the target with **iOS**, **Android** or **Capacitor**:
83
+ Open your application repository and give your assistant this prompt:
69
84
 
70
85
  ```text
71
- Read https://github.com/rdlabo-dev/cf-workers-native/blob/main/README.md
72
- and the integration guide for our target: <iOS, Android or Capacitor>.
73
- Bring this Workers application to that target using cf-workers-native@0.1.3.
74
- Preserve its pages, routes, authentication and Cloudflare deployment configuration.
75
- For an existing native app, preserve its entry point and navigation.
76
- Verify the actual user flows on the target platform and report remaining limits.
86
+ Read https://github.com/rdlabo-dev/cf-workers-native/blob/main/docs/integration.md.
87
+ Add an iOS and Android version of this Workers web app using cf-workers-native@0.1.4
88
+ and Capacitor. Preserve the existing pages, backend and Cloudflare deployment configuration.
89
+ Use an existing test Worker for cloud-backed requests; ask before any cloud deployment.
90
+ Start by verifying one page, navigation and a form or data action on a simulator/emulator.
91
+ Then verify the app's authentication and main user flow, and report remaining limits.
77
92
  ```
78
93
 
94
+ Provide your app name, application ID and test Worker URL if you have them.
95
+
96
+ ## Already have a native app?
97
+
98
+ Embed a Workers-powered screen in your existing [UIKit / SwiftUI app](docs/native-embedding.md#ios)
99
+ or [Android app](docs/native-embedding.md#android). These integrations use the
100
+ native SDKs and a shared web build. Follow the [dependency setup](docs/native-embedding.md#dependency-setup)
101
+ for the matching npm, SwiftPM and Maven versions and Android WebView requirements.
102
+
79
103
  ## Make it ready for your users
80
104
 
81
105
  Follow a real flow from launch to sign-out: load a page, navigate, submit a form, reopen the app and check what happens when the network is unavailable. Keep secrets on the Worker and enforce authentication and authorization there. The [integration checklist](docs/integration.md#6-verify-the-existing-application-in-capacitor) and [native embedding checks](docs/native-embedding.md#verification) explain what to verify.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cf-workers-native",
3
- "version": "0.1.3-beta.pr68.sha6899b03e59cc",
3
+ "version": "0.1.4",
4
4
  "license": "MIT",
5
5
  "description": "Bring Cloudflare Workers apps to iOS and Android.",
6
6
  "repository": {
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "publishConfig": {
25
25
  "access": "public",
26
- "tag": "beta"
26
+ "tag": "latest"
27
27
  },
28
28
  "type": "module",
29
29
  "files": [