Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

expo-modules-core

Package Overview
Dependencies
Maintainers
24
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

expo-modules-core - npm Package Compare versions

Comparing version 1.8.0 to 1.9.0

android/src/main/java/expo/modules/kotlin/types/SetTypeConverter.kt

2

build/NativeViewManagerAdapter.native.js

@@ -53,3 +53,3 @@ import React from 'react';

render() {
return React.createElement(ReactNativeComponent, { ...this.props });
return <ReactNativeComponent {...this.props}/>;
}

@@ -56,0 +56,0 @@ }

@@ -6,2 +6,3 @@ type ExpoObject = {

uuidv4: () => string;
uuidv5: (name: string, namespace: string) => string;
};

@@ -8,0 +9,0 @@ declare global {

@@ -0,1 +1,2 @@

import { NativeModules } from 'react-native';
import NativeModulesProxy from './NativeModulesProxy';

@@ -26,2 +27,3 @@ /**

export function requireOptionalNativeModule(moduleName) {
ensureNativeModulesAreInstalled();
return (globalThis.expo?.modules?.[moduleName] ??

@@ -32,2 +34,20 @@ globalThis.ExpoModules?.[moduleName] ??

}
/**
* Ensures that the native modules are installed in the current runtime.
* Otherwise, it synchronously calls a native function that installs them.
*/
function ensureNativeModulesAreInstalled() {
if (globalThis.expo) {
return;
}
try {
// TODO: ExpoModulesCore shouldn't be optional here,
// but to keep backwards compatibility let's just ignore it in SDK 50.
// In most cases the modules were already installed from the native side.
NativeModules.ExpoModulesCore?.installModules();
}
catch (error) {
console.error(`Unable to install Expo modules: ${error}`);
}
}
//# sourceMappingURL=requireNativeModule.js.map

@@ -1,4 +0,5 @@

import sha1 from './lib/sha1';
import v35 from './lib/v35';
import bytesToUuid from './lib/bytesToUuid';
import { Uuidv5Namespace } from './uuid.types';
const nativeUuidv4 = globalThis?.expo?.uuidv4;
const nativeUuidv5 = globalThis?.expo?.uuidv5;
function uuidv4() {

@@ -10,7 +11,19 @@ if (!nativeUuidv4) {

}
function uuidv5(name, namespace) {
const parsedNamespace = Array.isArray(namespace) && namespace.length === 16 ? bytesToUuid(namespace) : namespace;
// If parsed namespace is still an array it means that it wasn't valid
if (Array.isArray(parsedNamespace)) {
throw new Error('`namespace` must be a valid UUID string or an Array of 16 byte values');
}
if (!nativeUuidv5) {
throw Error("Native UUID type 5 generator implementation wasn't found in `expo-modules-core`");
}
return nativeUuidv5(name, parsedNamespace);
}
const uuid = {
v4: uuidv4,
v5: v35('v5', 0x50, sha1),
v5: uuidv5,
namespace: Uuidv5Namespace,
};
export default uuid;
//# sourceMappingURL=uuid.js.map

@@ -12,4 +12,14 @@ /**

*/
v5: (value: number[] | string, namespace: number[] | string, buf?: number[], offset?: number) => string;
v5: (name: string, namespace: string | number[]) => string;
namespace: typeof Uuidv5Namespace;
};
/**
* Default namespaces for UUID v5 defined in RFC 4122
*/
export declare enum Uuidv5Namespace {
dns = "6ba7b810-9dad-11d1-80b4-00c04fd430c8",
url = "6ba7b811-9dad-11d1-80b4-00c04fd430c8",
oid = "6ba7b812-9dad-11d1-80b4-00c04fd430c8",
x500 = "6ba7b814-9dad-11d1-80b4-00c04fd430c8"
}
//# sourceMappingURL=uuid.types.d.ts.map

@@ -1,2 +0,12 @@

export {};
/**
* Default namespaces for UUID v5 defined in RFC 4122
*/
export var Uuidv5Namespace;
(function (Uuidv5Namespace) {
// Source of the UUIDs: https://datatracker.ietf.org/doc/html/rfc4122
Uuidv5Namespace["dns"] = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
Uuidv5Namespace["url"] = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
Uuidv5Namespace["oid"] = "6ba7b812-9dad-11d1-80b4-00c04fd430c8";
Uuidv5Namespace["x500"] = "6ba7b814-9dad-11d1-80b4-00c04fd430c8";
})(Uuidv5Namespace || (Uuidv5Namespace = {}));
//# sourceMappingURL=uuid.types.js.map
import sha1 from './lib/sha1';
import v35 from './lib/v35';
import { Uuidv5Namespace } from './uuid.types';
function uuidv4() {

@@ -16,4 +17,5 @@ // Crypto needs to be required when run in Node.js environment.

v5: v35('v5', 0x50, sha1),
namespace: Uuidv5Namespace,
};
export default uuid;
//# sourceMappingURL=uuid.web.js.map

@@ -13,2 +13,26 @@ # Changelog

## 1.9.0 — 2023-10-17
### 🛠 Breaking changes
- Dropped support for Android SDK 21 and 22. ([#24201](https://github.com/expo/expo/pull/24201) by [@behenate](https://github.com/behenate))
### 🎉 New features
- Add `CommonExceptions.ModuleNotFound`. ([#24898](https://github.com/expo/expo/pull/24898) by [@lukmccall](https://github.com/lukmccall))
- [Android] `Set<T>` can now be passed as an argument to a module method. ([#24897](https://github.com/expo/expo/pull/24897) by [@lukmccall](https://github.com/lukmccall))
### 🐛 Bug fixes
- Fixed typed arrays couldn't be returned from synchronous functions. ([#24744](https://github.com/expo/expo/pull/24744) by [@lukmccall](https://github.com/lukmccall))
- [iOS] Fixed exception when deallocating shared objects. ([#24836](https://github.com/expo/expo/pull/24836) by [@kudo](https://github.com/kudo))
- [Android] Fixed `null` or `undefined` wasn't converted to `JavaScriptValue`. ([#24899](https://github.com/expo/expo/pull/24899) by [@lukmccall](https://github.com/lukmccall))
### 💡 Others
- Improve tracking on Android. ([#24625](https://github.com/expo/expo/pull/24625) by [@lukmccall](https://github.com/lukmccall))
- Use native UUIDv5 generation on `Android` and `iOS`. ([#24200](https://github.com/expo/expo/pull/24200) by [@behenate](https://github.com/behenate))
- Ensure native modules are installed before required. ([#24746](https://github.com/expo/expo/pull/24746) by [@tsapeta](https://github.com/tsapeta))
- Clean up and restructure the modules core package directory. ([#24816](https://github.com/expo/expo/pull/24816) by [@tsapeta](https://github.com/tsapeta))
## 1.8.0 — 2023-09-15

@@ -15,0 +39,0 @@

{
"name": "expo-modules-core",
"version": "1.8.0",
"version": "1.9.0",
"description": "The core of Expo Modules architecture",

@@ -44,3 +44,3 @@ "main": "build/index.js",

},
"gitHead": "ee2c866ba3c7fbc35ff2a3e896041cf15d3bd7c5"
"gitHead": "da25937e2a99661cbe5eb60ca1d8d6245fc96a50"
}

@@ -0,1 +1,3 @@

import { NativeModules } from 'react-native';
import NativeModulesProxy from './NativeModulesProxy';

@@ -10,2 +12,3 @@

uuidv4: () => string;
uuidv5: (name: string, namespace: string) => string;
};

@@ -56,2 +59,4 @@

): ModuleType | null {
ensureNativeModulesAreInstalled();
return (

@@ -64,1 +69,19 @@ globalThis.expo?.modules?.[moduleName] ??

}
/**
* Ensures that the native modules are installed in the current runtime.
* Otherwise, it synchronously calls a native function that installs them.
*/
function ensureNativeModulesAreInstalled(): void {
if (globalThis.expo) {
return;
}
try {
// TODO: ExpoModulesCore shouldn't be optional here,
// but to keep backwards compatibility let's just ignore it in SDK 50.
// In most cases the modules were already installed from the native side.
NativeModules.ExpoModulesCore?.installModules();
} catch (error) {
console.error(`Unable to install Expo modules: ${error}`);
}
}

@@ -1,6 +0,6 @@

import sha1 from './lib/sha1';
import v35 from './lib/v35';
import { UUID } from './uuid.types';
import bytesToUuid from './lib/bytesToUuid';
import { UUID, Uuidv5Namespace } from './uuid.types';
const nativeUuidv4 = globalThis?.expo?.uuidv4;
const nativeUuidv5 = globalThis?.expo?.uuidv5;

@@ -17,6 +17,23 @@ function uuidv4(): string {

function uuidv5(name: string, namespace: string | number[]) {
const parsedNamespace =
Array.isArray(namespace) && namespace.length === 16 ? bytesToUuid(namespace) : namespace;
// If parsed namespace is still an array it means that it wasn't valid
if (Array.isArray(parsedNamespace)) {
throw new Error('`namespace` must be a valid UUID string or an Array of 16 byte values');
}
if (!nativeUuidv5) {
throw Error("Native UUID type 5 generator implementation wasn't found in `expo-modules-core`");
}
return nativeUuidv5(name, parsedNamespace);
}
const uuid: UUID = {
v4: uuidv4,
v5: v35('v5', 0x50, sha1),
v5: uuidv5,
namespace: Uuidv5Namespace,
};
export default uuid;

@@ -12,8 +12,15 @@ /**

*/
v5: (
value: number[] | string,
namespace: number[] | string,
buf?: number[],
offset?: number
) => string;
v5: (name: string, namespace: string | number[]) => string;
namespace: typeof Uuidv5Namespace;
};
/**
* Default namespaces for UUID v5 defined in RFC 4122
*/
export enum Uuidv5Namespace {
// Source of the UUIDs: https://datatracker.ietf.org/doc/html/rfc4122
dns = '6ba7b810-9dad-11d1-80b4-00c04fd430c8',
url = '6ba7b811-9dad-11d1-80b4-00c04fd430c8',
oid = '6ba7b812-9dad-11d1-80b4-00c04fd430c8',
x500 = '6ba7b814-9dad-11d1-80b4-00c04fd430c8',
}
import sha1 from './lib/sha1';
import v35 from './lib/v35';
import { UUID } from './uuid.types';
import { UUID, Uuidv5Namespace } from './uuid.types';

@@ -21,3 +21,5 @@ function uuidv4(): string {

v5: v35('v5', 0x50, sha1),
namespace: Uuidv5Namespace,
};
export default uuid;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc