Skip to content

Commit

Permalink
Release v1.0.0-beta.0 (#169)
Browse files Browse the repository at this point in the history
* Version 1.0.0-rc.0

* handle NSNull in json argument (#170)

* support both web and native, and full rollbar.js config (#171)

* Use platform specific imports for Rollbar.js (#172)

* rename Rollbar.js file to Client.js

* update ts type definitions

* use platform specific import for Rollbar.js

* feat: replace rollbar-ios with rollbar-apple (#175)

* downgrade release from rc to beta

* pin RollbarNotifier to 3.0.3

* update yarn.lock
  • Loading branch information
waltjones authored Jul 10, 2023
1 parent 9f7dce6 commit 4a88a17
Show file tree
Hide file tree
Showing 23 changed files with 611 additions and 495 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

9 changes: 5 additions & 4 deletions RollbarReactNative.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'RollbarReactNative'
s.version = '0.9.3'
s.version = '1.0.0-beta.0'
s.summary = 'RollbarReactNative'
s.description = <<-DESC
RollbarReactNative is a library for interacting with the Rollbar
Expand All @@ -10,12 +10,13 @@ Pod::Spec.new do |s|
s.license = 'MIT'
s.author = { 'Rollbar' => '[email protected]' }
s.platform = :ios, '7.0'
s.source = { :git => 'https://github.com/author/RollbarReactNative.git', :tag => 'v0.8.0' }
s.source = { :git => 'https://github.com/rollbar/rollbar-react-native.git', :tag => '1.0.0-beta.0' }
s.requires_arc = true

s.dependency 'React-Core'
s.dependency 'Rollbar', '~> 1.12.8'

s.dependency 'RollbarNotifier', '3.0.3'
s.source_files = 'ios/RollbarReactNative.{h,m}'
s.public_header_files = 'ios/RollbarReactNative.h'

s.compiler_flags = '-fmodules', '-fcxx-modules'
end
2 changes: 1 addition & 1 deletion android/src/main/java/com/rollbar/RollbarReactNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
public class RollbarReactNative extends ReactContextBaseJavaModule {
private static final String REACT_NATIVE = "react-native";
private static final String NOTIFIER_NAME = "rollbar-react-native";
private static final String NOTIFIER_VERSION = "0.9.3";
private static final String NOTIFIER_VERSION = "1.0.0-beta.0";
private static final String MANIFEST_CODE_VERSION = "com.rollbar.android.CODE_VERSION";

private ReactContext reactContext;
Expand Down
27 changes: 7 additions & 20 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
export class Client {
constructor(config: Configuration | string);
constructor(config: ConfigurationOptions);

public rollbar: Rollbar;

public captureUncaughtExceptions(): void;
public captureUnhandledRejections(): void;
Expand All @@ -11,12 +13,12 @@ export class Client {
public error(obj: LogArgument, extra?: Extra, callback?: Callback): LogResult;
public critical(obj: LogArgument, extra?: Extra, callback?: Callback): LogResult;

public setPerson(id: string, name?: string, email?: string): void;
public setPerson(id: string | null, name?: string | null, email?: string | null): void;
public clearPerson(): void;
}

export class Configuration {
constructor(accessToken: string, options?: ConfigurationOptions);
constructor(options?: ConfigurationOptions);
public setPlatform(platform: string): void;
public toJSON(): object;
}
Expand All @@ -29,20 +31,5 @@ export interface LogResult {
export type MaybeError = Error | undefined | null;
export type Callback = (err: MaybeError, response: object) => void;

export interface ConfigurationOptions {
environment?: string;
logLevel?: string;
reportLevel?: string;
endpoint?: string;
appVersion?: string;
codeBundleId?: string;
releaseStage?: string;
enabledReleaseStages?: string[];
captureUncaught?: boolean;
captureUnhandledRejections?: boolean;
captureDeviceInfo?: boolean;
payload?: object;
enabled?: boolean;
verbose?: boolean;
transform?: (data: object) => void;
}
export type Rollbar = import("rollbar").Rollbar;
export type ConfigurationOptions = import("rollbar").Configuration;
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
'use strict'
module.exports = require('./lib/Rollbar');
module.exports = require('./lib/Client');
199 changes: 145 additions & 54 deletions ios/RollbarReactNative.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,78 +3,169 @@
#else
#import "RCTBridgeModule.h"
#endif
#if __has_include(<Rollbar/Rollbar.h>)
#import <Rollbar/Rollbar.h>
#else
#import "Rollbar.h"
#endif

@interface RollbarReactNative : NSObject <RCTBridgeModule>

+ (void)initWithAccessToken:(NSString *)accessToken;
+ (void)initWithAccessToken:(NSString *)accessToken configuration:(RollbarConfiguration *)config;
+ (void)initWithAccessToken:(NSString *)accessToken configuration:(RollbarConfiguration*)configuration enableCrashReporter:(BOOL)enable;
+ (void)initWithConfiguration:(nonnull NSDictionary *)configuration;

+ (void)log:(nonnull NSString*)level message:(nonnull NSString*)message;
+ (void)log:(nonnull NSString*)level exception:(nonnull NSException*)exception;
+ (void)log:(nonnull NSString*)level error:(nonnull NSError*)error;

+ (void)log:(nonnull NSString*)level
message:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)log:(nonnull NSString*)level
exception:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)log:(nonnull NSString*)level
error:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)log:(nonnull NSString*)level
message:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)log:(nonnull NSString*)level
exception:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)log:(nonnull NSString*)level
error:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)debugMessage:(nonnull NSString*)message;
+ (void)debugException:(nonnull NSException*)exception;
+ (void)debugError:(nonnull NSError*)error;

+ (void)debugMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debugException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debugError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debugMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)debugException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)debugError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)infoMessage:(nonnull NSString*)message;
+ (void)infoException:(nonnull NSException*)exception;
+ (void)infoError:(nonnull NSError*)error;

+ (void)infoMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)infoException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)infoError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)infoMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)infoException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)infoError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)warningMessage:(nonnull NSString*)message;
+ (void)warningException:(nonnull NSException*)exception;
+ (void)warningError:(nonnull NSError*)error;

+ (void)warningMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warningException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warningError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warningMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)warningException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)warningError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

// Old methods for backwards compatability
+ (void)errorMessage:(nonnull NSString*)message;
+ (void)errorException:(nonnull NSException*)exception;
+ (void)errorError:(nonnull NSError*)error;

+ (void)logWithLevel:(NSString*)level message:(NSString*)message;
+ (void)logWithLevel:(NSString*)level message:(NSString*)message data:(NSDictionary*)data;
+ (void)logWithLevel:(NSString*)level data:(NSDictionary*)data;
+ (void)errorMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debugWithMessage:(NSString*)message;
+ (void)debugWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)debugWithData:(NSDictionary*)data;
+ (void)errorException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)infoWithMessage:(NSString*)message;
+ (void)infoWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)infoWithData:(NSDictionary*)data;
+ (void)errorError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warningWithMessage:(NSString*)message;
+ (void)warningWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)warningWithData:(NSDictionary*)data;
+ (void)errorMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)errorWithMessage:(NSString*)message;
+ (void)errorWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)errorWithData:(NSDictionary*)data;
+ (void)errorException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)criticalWithMessage:(NSString*)message;
+ (void)criticalWithMessage:(NSString*)message data:(NSDictionary*)data;
+ (void)criticalWithData:(NSDictionary*)data;
+ (void)errorError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

// New interface
+ (void)criticalMessage:(nonnull NSString*)message;
+ (void)criticalException:(nonnull NSException*)exception;
+ (void)criticalError:(nonnull NSError*)error;

+ (void)log:(RollbarLevel)level message:(NSString*)message;
+ (void)log:(RollbarLevel)level message:(NSString*)message exception:(NSException*)exception;
+ (void)log:(RollbarLevel)level message:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)log:(RollbarLevel)level message:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)debug:(NSString*)message;
+ (void)debug:(NSString*)message exception:(NSException*)exception;
+ (void)debug:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)debug:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)info:(NSString*)message;
+ (void)info:(NSString*)message exception:(NSException*)exception;
+ (void)info:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)info:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data;

+ (void)warning:(NSString*)message;
+ (void)warning:(NSString*)message exception:(NSException*)exception;
+ (void)warning:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)warning:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalMessage:(nonnull NSString*)message
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)error:(NSString*)message;
+ (void)error:(NSString*)message exception:(NSException*)exception;
+ (void)error:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)error:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalException:(nonnull NSException*)exception
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

+ (void)critical:(NSString*)message;
+ (void)critical:(NSString*)message exception:(NSException*)exception;
+ (void)critical:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data;
+ (void)critical:(NSString*)message exception:(NSException*)exception data:(NSDictionary*)data context:(NSString*)context;
+ (void)criticalError:(nonnull NSError*)error
data:(nullable NSDictionary<NSString *, id> *)data
context:(nullable NSString *)context;

- (void)init:(NSDictionary *)options;
- (void)setPerson:(NSDictionary *)personInfo;
- (void)init:(nonnull NSDictionary *)options;
- (void)setPerson:(nonnull NSDictionary *)personInfo;
- (void)clearPerson;

@end
Loading

0 comments on commit 4a88a17

Please sign in to comment.