@rise-x/apps-sdk 0.16.0 → 0.16.1
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.
- package/README.md +17 -2
- package/build/rsbuild/index.js +8 -0
- package/build/ui/map-worker-source.js +2 -0
- package/build/ui/standalone.js +78 -904
- package/package.json +4 -1
package/README.md
CHANGED
|
@@ -761,8 +761,11 @@ Requirements in the app:
|
|
|
761
761
|
|
|
762
762
|
2. Federated, components render from the shell's copy. The preset's standalone
|
|
763
763
|
branch aliases `@rise-x/ui` to the SDK's own
|
|
764
|
-
compiled bundle (`./ui/standalone`) instead
|
|
765
|
-
|
|
764
|
+
compiled bundle (`./ui/standalone`) instead: a snapshot with its CSS
|
|
765
|
+
self-injected, so components render for real with no shell. `MapView`'s
|
|
766
|
+
libraries (`leaflet`, `maplibre-gl`, and `@maplibre/maplibre-gl-leaflet`)
|
|
767
|
+
aren't in it. They install as dependencies of the SDK, and your app's
|
|
768
|
+
bundler loads each one in its own chunk when a map needs it.
|
|
766
769
|
It's a snapshot, not the source of truth: verify in a host (or deployed)
|
|
767
770
|
before release.
|
|
768
771
|
|
|
@@ -806,6 +809,18 @@ import { MapView, mapPin } from '@rise-x/apps-sdk/ui';
|
|
|
806
809
|
custom raster layer (`{ url, ...TileLayerOptions }`), a MapLibre style
|
|
807
810
|
(`{ style }`), or `null` for no basemap at all.
|
|
808
811
|
|
|
812
|
+
OpenStreetMap blocks tile requests that carry no `Referer`, and a host page
|
|
813
|
+
whose `Referrer-Policy` is `same-origin` or `no-referrer` strips it. The
|
|
814
|
+
`streets` preset sets `referrerPolicy: 'strict-origin-when-cross-origin'` for
|
|
815
|
+
this. Pass the same option to any OpenStreetMap layer you add yourself:
|
|
816
|
+
|
|
817
|
+
```tsx
|
|
818
|
+
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
819
|
+
referrerPolicy: 'strict-origin-when-cross-origin',
|
|
820
|
+
attribution: '© OpenStreetMap',
|
|
821
|
+
}).addTo(map);
|
|
822
|
+
```
|
|
823
|
+
|
|
809
824
|
The built-in presets fetch from third-party hosts, so the host page's CSP must
|
|
810
825
|
allow them: `light` and `dark` need `connect-src https://tiles.openfreemap.org`
|
|
811
826
|
and `worker-src blob:` (MapLibre renders in a web worker); `streets` and
|
package/build/rsbuild/index.js
CHANGED
|
@@ -163,6 +163,14 @@ function defineAppConfig({ pkg, port, standalone = false, exposes, define, }) {
|
|
|
163
163
|
'react-dom': (0, node_path_1.dirname)(appRequire.resolve('react-dom/package.json')),
|
|
164
164
|
},
|
|
165
165
|
},
|
|
166
|
+
tools: {
|
|
167
|
+
...base.tools,
|
|
168
|
+
rspack: {
|
|
169
|
+
// MapLibre's worker-URL helper trips this on every build, and Rsbuild
|
|
170
|
+
// prints its whole minified line; MapView sets the worker itself.
|
|
171
|
+
ignoreWarnings: [{ module: /[/\\]maplibre-gl[/\\]/, message: /Critical dependency/ }],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
166
174
|
};
|
|
167
175
|
}
|
|
168
176
|
return {
|