Skip to content

Commit

Permalink
Remove references to os for Edge Runtime compatibility (#115)
Browse files Browse the repository at this point in the history
## Problem

PR #110 resolved the problem with `fs` imports that was happening in the
Edge Runtime, but feedback on a dev build shows that `os` imports are
still an issue even though the `@edge-runtime/jest-environment` test
build is passing.

This relates to:
- #108 

## Solution

For now, the easiest thing is to just remove references to `os`. The
information it adds to the user-agent header is nice to have, but not
essential.

## Type of Change

- [x] Bug fix (non-breaking change which fixes an issue)
  • Loading branch information
jhamon authored Sep 14, 2023
1 parent 6bc752b commit 73536bb
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
11 changes: 0 additions & 11 deletions src/utils/os.ts

This file was deleted.

8 changes: 1 addition & 7 deletions src/utils/user-agent.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { getOSInfo } from './os';
import { isEdge } from './environment';
import * as packageInfo from '../version.json';

Expand All @@ -11,12 +10,7 @@ export const buildUserAgent = (isLegacy: boolean) => {
'lang=typescript',
];

if (!isEdge()) {
const osInfo = getOSInfo();
if (osInfo) {
userAgentParts.push(osInfo);
}
} else {
if (isEdge()) {
userAgentParts.push('Edge Runtime');
}

Expand Down

0 comments on commit 73536bb

Please sign in to comment.