Skip to content

Commit c1ffecf

Browse files
chore: Remove iOS-device-list dependency (#87829)
The node package ios-device list is unmaintained, and we no longer use it. Therefore, we can remove it. This PR also adds a comment that we currently manually update the device list. This is for #68258.
1 parent ad8f033 commit c1ffecf

File tree

6 files changed

+8
-140
lines changed

6 files changed

+8
-140
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@
118118
"gettext-parser": "1.3.1",
119119
"gl-matrix": "^3.4.3",
120120
"invariant": "^2.2.4",
121-
"ios-device-list": "1.1.37",
122121
"jed": "^1.1.0",
123122
"jest-fetch-mock": "^3.0.3",
124123
"js-beautify": "^1.15.1",

scripts/extract-ios-device-names.ts

Lines changed: 0 additions & 106 deletions
This file was deleted.

static/app/components/deviceName.spec.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import {render, screen} from 'sentry-test/reactTestingLibrary';
22

33
import {DeviceName} from 'sentry/components/deviceName';
44

5-
jest.mock('ios-device-list');
6-
75
describe('DeviceName', () => {
86
it('renders device name if module is loaded', async () => {
97
render(<DeviceName value="iPhone8,2" />);

static/app/constants/ios-device-list.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
// THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
2-
// generated using scripts/extract-ios-device-names.ts as part of build step.
3-
// the purpose of the script is to extract only the iOS information that Sentry cares about
4-
// and discard the rest of the JSON so we do not end up bloating bundle size.
1+
// When updating this file, please also update
2+
// Relay: https://github.com/getsentry/relay/blob/a91f0c92860f88789ad6092ef5b1062aa3e34b80/relay-event-schema/src/protocol/device_class.rs
3+
// Python: https://github.com/getsentry/sentry/blob/c53745bb716899758d0f1caf5446d830e4ebbdb2/src/sentry/api/helpers/ios_models.py
4+
5+
// We used to auto-generate this file from the ios-device-list library the node package (https://www.npmjs.com/package/ios-device-list)
6+
// is unmaintained; see https://github.com/pbakondy/ios-device-list.
7+
// Therefore, we manually update the device mapping list below.
8+
// You can check https://gist.github.com/adamawolf/3048717 or https://theapplewiki.com/wiki/models for a comprehensive list of Apple devices.
59

6-
// see https://theapplewiki.com/wiki/models
710
const iOSDeviceMapping: Record<string, string> = {
811
// iPod touch
912
'iPod1,1': 'iPod touch',

webpack.config.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -451,13 +451,6 @@ const appConfig: webpack.Configuration = {
451451
less: path.join(staticPrefix, 'less'),
452452
'sentry-test': path.join(__dirname, 'tests', 'js', 'sentry-test'),
453453
'sentry-locale': path.join(__dirname, 'src', 'sentry', 'locale'),
454-
'ios-device-list': path.join(
455-
__dirname,
456-
'node_modules',
457-
'ios-device-list',
458-
'dist',
459-
'ios-device-list.min.js'
460-
),
461454
},
462455

463456
fallback: {

yarn.lock

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7875,15 +7875,6 @@ [email protected], invariant@^2.2.4:
78757875
dependencies:
78767876
loose-envify "^1.0.0"
78777877

7878-
7879-
version "1.1.37"
7880-
resolved "https://registry.yarnpkg.com/ios-device-list/-/ios-device-list-1.1.37.tgz#0461dcba91ff824422740cfabc32490bfd95e686"
7881-
integrity sha512-0CS8kand3WDF58GtQV7AlFl9mONeHyQDtrypNEVSUyFsxNcbvj/o4gGeS/LNrQAK8V8V4rSIIpxx3hBVDDFwIg==
7882-
dependencies:
7883-
lodash.clonedeep "^4.5.0"
7884-
lodash.flatten "^4.4.0"
7885-
lodash.uniq "^4.5.0"
7886-
78877878
78887879
version "1.9.1"
78897880
resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.1.tgz#bff38543eeb8984825079ff3a2a8e6cbd46781b3"
@@ -9046,21 +9037,11 @@ locate-path@^6.0.0:
90469037
dependencies:
90479038
p-locate "^5.0.0"
90489039

9049-
lodash.clonedeep@^4.5.0:
9050-
version "4.5.0"
9051-
resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef"
9052-
integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=
9053-
90549040
lodash.debounce@^4.0.8:
90559041
version "4.0.8"
90569042
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
90579043
integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==
90589044

9059-
lodash.flatten@^4.4.0:
9060-
version "4.4.0"
9061-
resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f"
9062-
integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8=
9063-
90649045
lodash.isequal@^4.0.0:
90659046
version "4.5.0"
90669047
resolved "https://registry.yarnpkg.com/lodash.isequal/-/lodash.isequal-4.5.0.tgz#415c4478f2bcc30120c22ce10ed3226f7d3e18e0"

0 commit comments

Comments
 (0)