Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(deps): remove iso8601 dep #9368

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions ios/Artsy/Models/API_Models/Application/SystemTime.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

#import "ARMacros.h"

#import <ISO8601DateFormatter/ISO8601DateFormatter.h>

@interface SystemTime ()
@property (nonatomic, readonly, strong) NSString *time;
@property (nonatomic, readonly, assign) NSInteger day;
Expand Down Expand Up @@ -32,9 +30,9 @@ + (NSDictionary *)JSONKeyPathsByPropertyKey
};
}

- (NSDate *)date
- (nullable NSDate *)date
{
ISO8601DateFormatter *dateFormatter = [[ISO8601DateFormatter alloc] init];
NSISO8601DateFormatter *dateFormatter = [[NSISO8601DateFormatter alloc] init];
return [dateFormatter dateFromString:self.iso8601];
}

Expand Down
5 changes: 2 additions & 3 deletions ios/Artsy/Networking/API_Modules/ARUserManager.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#import <ISO8601DateFormatter/ISO8601DateFormatter.h>
#import <UICKeyChainStore/UICKeyChainStore.h>

#import "ARDefaults.h"
Expand Down Expand Up @@ -136,7 +135,7 @@ - (void)handleAuthState:(NSString *)token
}];

// Create an Expiration Date
ISO8601DateFormatter *dateFormatter = [[ISO8601DateFormatter alloc] init];
NSISO8601DateFormatter *dateFormatter = [[NSISO8601DateFormatter alloc] init];
NSDate *expiryDate = [dateFormatter dateFromString:expiryDateString];
[self saveUserOAuthToken:token expiryDate:expiryDate];
}
Expand Down Expand Up @@ -218,7 +217,7 @@ - (void)testOnly_setupUser:(NSString *)username

[ARRouter setAuthToken:token];

ISO8601DateFormatter *dateFormatter = [[ISO8601DateFormatter alloc] init];
NSISO8601DateFormatter *dateFormatter = [[NSISO8601DateFormatter alloc] init];
NSDate *expiryDate = [dateFormatter dateFromString:expiryDateString];


Expand Down
3 changes: 1 addition & 2 deletions ios/Artsy/Networking/ArtsyAPI.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#import "MTLModel+JSON.h"
#import "AFHTTPRequestOperation+JSON.h"

#import <ISO8601DateFormatter/ISO8601DateFormatter.h>
#import <UICKeyChainStore/UICKeyChainStore.h>
#import <ObjectiveSugar/ObjectiveSugar.h>

Expand Down Expand Up @@ -219,7 +218,7 @@ - (void)getXappTokenWithCompletion:(void (^)(NSString *xappToken, NSDate *expira
NSString *token = JSON[ARXAppToken];
NSString *date = JSON[AROExpiryDateKey];

ISO8601DateFormatter *dateFormatter = [[ISO8601DateFormatter alloc] init];
NSISO8601DateFormatter *dateFormatter = [[NSISO8601DateFormatter alloc] init];
NSDate *expiryDate = [dateFormatter dateFromString:date];

NSString *oldxToken = [UICKeyChainStore stringForKey:ARXAppTokenKeychainKey];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class LiveAuctionEventViewModel: NSObject, LiveAuctionEventViewModelType {
}

var dateEventCreated: Date {
return ARStandardDateFormatter.shared().date(from: event.createdAtString)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was actually nullable before but not specified in Obj-C code, so in theory this is no more dangerous, still worth thinking about handling nils if we are going to continue using native live auctions for a long time

return ARStandardDateFormatter.shared().date(from: event.createdAtString)!
}

func hasBidderID(_ bidderID: String) -> Bool {
Expand Down
5 changes: 1 addition & 4 deletions ios/Artsy/View_Controllers/Util/ARStandardDateFormatter.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#import <ISO8601DateFormatter/ISO8601DateFormatter.h>


@interface ARStandardDateFormatter : ISO8601DateFormatter
@interface ARStandardDateFormatter : NSISO8601DateFormatter

/// Shared date formatter for ISO8601 text to NSDates
+ (ARStandardDateFormatter *)sharedFormatter;
Expand Down
1 change: 0 additions & 1 deletion ios/ArtsyTests/Supporting_Files/Artsy_Tests-Prefix.pch
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

// Pods that come in from the other target
#import <AFNetworking/AFHTTPRequestOperation.h>
#import <ISO8601DateFormatter/ISO8601DateFormatter.h>
#import <UICKeyChainStore/UICKeyChainStore.h>
#import <Mantle/Mantle.h>
#import <Mantle/MTLJSONAdapter.h>
Expand Down
1 change: 0 additions & 1 deletion ios/Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ target 'Artsy' do
pod 'CocoaLumberjack', '3.7.2'
pod 'FLKAutoLayout', git: 'https://github.com/artsy/FLKAutoLayout.git', branch: 'v1'
pod 'FXBlurView', '1.6.4'
pod 'ISO8601DateFormatter', git: 'https://github.com/artsy/iso-8601-date-formatter'
pod 'JSDecoupledAppDelegate'
pod 'Mantle', '1.5.6'
pod 'MMMarkdown', '0.4'
Expand Down
13 changes: 4 additions & 9 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ PODS:
- INTUAnimationEngine (1.4.2):
- INTUAnimationEngine/SpringSolver (= 1.4.2)
- INTUAnimationEngine/SpringSolver (1.4.2)
- ISO8601DateFormatter (0.7.1)
- ISO8601DateFormatter (0.8)
- JSDecoupledAppDelegate (1.2.0)
- JWT (3.0.0-beta.14):
- Base64 (~> 1.1.2)
Expand Down Expand Up @@ -803,7 +803,6 @@ DEPENDENCIES:
- hermes-engine (from `../node_modules/react-native/sdks/hermes/hermes-engine.podspec`)
- Interstellar/Core (from `https://github.com/artsy/Interstellar.git`, branch `observable-unsubscribe`)
- INTUAnimationEngine
- ISO8601DateFormatter (from `https://github.com/artsy/iso-8601-date-formatter`)
- JSDecoupledAppDelegate
- JWTDecode (= 2.0.0)
- libevent (~> 2.1.12)
Expand Down Expand Up @@ -949,6 +948,7 @@ SPEC REPOS:
- GTMAppAuth
- GTMSessionFetcher
- INTUAnimationEngine
- ISO8601DateFormatter
- JSDecoupledAppDelegate
- JWT
- JWTDecode
Expand Down Expand Up @@ -1019,8 +1019,6 @@ EXTERNAL SOURCES:
Interstellar:
:branch: observable-unsubscribe
:git: https://github.com/artsy/Interstellar.git
ISO8601DateFormatter:
:git: https://github.com/artsy/iso-8601-date-formatter
Pulley:
:branch: master
:git: https://github.com/artsy/Pulley.git
Expand Down Expand Up @@ -1180,9 +1178,6 @@ CHECKOUT OPTIONS:
Interstellar:
:commit: ca22646f5a8449795fba3d3436a045da0aeb5949
:git: https://github.com/artsy/Interstellar.git
ISO8601DateFormatter:
:commit: 1a48b819c85903ded669e74e476aceffebf311fc
:git: https://github.com/artsy/iso-8601-date-formatter
Pulley:
:commit: f677b18b332ea3798dc379879dbc0d038efd3ccc
:git: https://github.com/artsy/Pulley.git
Expand Down Expand Up @@ -1244,7 +1239,7 @@ SPEC CHECKSUMS:
hermes-engine: 724382db3322a3745b0741d753bbe70e26927aac
Interstellar: ab67502af03105f92100a043e178d188a1a437c9
INTUAnimationEngine: 3a7d63738cd51af573d16848a771feedea7cc9f2
ISO8601DateFormatter: 8311a2d4e265b269b2fed7ab4db685dcb0a7ccb2
ISO8601DateFormatter: 4551b6ce4f83185425f583b0b3feb3c7b59b942c
JSDecoupledAppDelegate: 5905e144cbe6e0c889248eebbee6784510f315e1
JWT: ef71dfb03e1f842081e64dc42eef0e164f35d251
JWTDecode: 178e47e5d28d3abcff778bacced8342858cd6cb5
Expand Down Expand Up @@ -1357,6 +1352,6 @@ SPEC CHECKSUMS:
Yoga: 445485143df46a9d5d4ef61cbbc629fec40fb9a0
YogaKit: f782866e155069a2cca2517aafea43200b01fd5a

PODFILE CHECKSUM: 7cdf980197550e52c92f54771a8ce7abe257b0de
PODFILE CHECKSUM: bbce440a616bb7a18dbfd360f07f48c1dbd91d84

COCOAPODS: 1.12.1