Skip to content

Commit

Permalink
Fix react ref bug in debug mode (#187)
Browse files Browse the repository at this point in the history
* fix bug when logging react ref in debug mode

* bump beta version

* just log object instead of stringifying in debug logs

* bump version
  • Loading branch information
kochis authored Oct 31, 2024
1 parent e15fe97 commit de85938
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Radar.initialize('prj_test_pk_...', { /* options */ });
Add the following script in your `html` file
```html
<script src="https://js.radar.com/v4.4.5/radar.min.js"></script>
<script src="https://js.radar.com/v4.4.6-beta.1/radar.min.js"></script>
```

Then initialize the Radar SDK
Expand All @@ -73,8 +73,8 @@ To create a map, first initialize the Radar SDK with your publishable key. Then
```html
<html>
<head>
<link href="https://js.radar.com/v4.4.5/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.5/radar.min.js"></script>
<link href="https://js.radar.com/v4.4.6-beta.1/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.6-beta.1/radar.min.js"></script>
</head>

<body>
Expand All @@ -98,8 +98,8 @@ To create an autocomplete input, first initialize the Radar SDK with your publis
```html
<html>
<head>
<link href="https://js.radar.com/v4.4.5/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.5/radar.min.js"></script>
<link href="https://js.radar.com/v4.4.6-beta.1/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.6-beta.1/radar.min.js"></script>
</head>

<body>
Expand Down Expand Up @@ -130,8 +130,8 @@ To power [geofencing](https://radar.com/documentation/geofencing/overview) exper
```html
<html>
<head>
<link href="https://js.radar.com/v4.4.5/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.5/radar.min.js"></script>
<link href="https://js.radar.com/v4.4.6-beta.1/radar.css" rel="stylesheet">
<script src="https://js.radar.com/v4.4.6-beta.1/radar.min.js"></script>
</head>

<body>
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "radar-sdk-js",
"version": "4.4.5",
"version": "4.4.6-beta.1",
"description": "Web Javascript SDK for Radar, location infrastructure for mobile and web apps.",
"homepage": "https://radar.com",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class Radar {

Logger.info(`initialized with ${live ? 'live' : 'test'} publishableKey.`);
if (options.debug) {
Logger.info(`using options: ${JSON.stringify(options)}`);
Logger.debug('using options', options);
}

// NOTE(jasonl): this allows us to run jest tests
Expand Down
4 changes: 2 additions & 2 deletions src/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ const getLevel = (): number => {
}

class Logger {
public static debug(message: string) {
public static debug(message: string, options?: any) {
if (getLevel() === LOG_LEVELS.debug) {
console.log(`Radar SDK (debug): ${message.trim()}`);
console.log(`Radar SDK (debug): ${message.trim()}`, options);
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ui/RadarMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class RadarMap extends maplibregl.Map {
radarMapOptions,
{ style },
);
Logger.debug(`initialize map with options: ${JSON.stringify(mapOptions)}`);
Logger.debug('map initailized with options', mapOptions);

(mapOptions as maplibregl.MapOptions).transformRequest = (url, resourceType) => {
// this handles when a style is switched
Expand Down
2 changes: 1 addition & 1 deletion src/ui/autocomplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ class AutocompleteUI {
this.inputField.addEventListener('blur', this.close.bind(this), true);
}

Logger.debug(`AutocompleteUI iniailized with options: ${JSON.stringify(this.config)}`);
Logger.debug('AutocompleteUI initialized with options', this.config);
}

public handleInput() {
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export default '4.4.5';
export default '4.4.6-beta.1';

0 comments on commit de85938

Please sign in to comment.