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

rollback #URL macro #2585

Merged
merged 3 commits into from
Mar 13, 2024
Merged
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
3 changes: 1 addition & 2 deletions Core/AppURLs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import BrowserServicesKit
import Foundation
import Macros

public extension URL {

Expand Down Expand Up @@ -49,7 +48,7 @@ public extension URL {
static let exti = URL(string: "\(base)/exti/\(devMode)")!
static let feedback = URL(string: "\(base)/feedback.js?type=app-feedback")!

static let appStore = #URL("https://apps.apple.com/app/duckduckgo-privacy-browser/id663592361")
static let appStore = URL(string: "https://apps.apple.com/app/duckduckgo-privacy-browser/id663592361")!

static let mac = URL(string: "\(base)/mac")!
static let windows = URL(string: "\(base)/windows")!
Expand Down
3 changes: 1 addition & 2 deletions Core/BookmarksImporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import Bookmarks
import Common
import Foundation
import Macros
import Persistence
import SwiftSoup

Expand Down Expand Up @@ -218,7 +217,7 @@ final public class BookmarksImporter {
static let FavoritesFolder = "DuckDuckGo Favorites"
static let BookmarksFolder = "DuckDuckGo Bookmarks"
static let bookmarkURLString = "https://duckduckgo.com"
static let bookmarkURL = #URL("https://duckduckgo.com")
static let bookmarkURL = URL(string: "https://duckduckgo.com")!
static let favoriteAttribute = "duckduckgo:favorite"
static let isFavorite = "true"
static let idAttribute = "id"
Expand Down
3 changes: 1 addition & 2 deletions Core/DataStoreWarmup.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
//

import Combine
import Macros
import WebKit

/// WKWebsiteDataStore is basically non-functional until a web view has been instanciated and a page is successfully loaded.
Expand All @@ -28,7 +27,7 @@ public class DataStoreWarmup {

@MainActor
public func ensureReady() async {
await BlockingNavigationDelegate().loadInBackgroundWebView(url: #URL("about:blank"))
await BlockingNavigationDelegate().loadInBackgroundWebView(url: URL(string: "about:blank")!)
}

}
Expand Down
3 changes: 1 addition & 2 deletions Core/UserAgentManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import BrowserServicesKit
import Common
import Foundation
import Macros
import WebKit

public protocol UserAgentManager {
Expand All @@ -47,7 +46,7 @@ public class DefaultUserAgentManager: UserAgentManager {

private func prepareUserAgent() {
let webview = WKWebView()
webview.load(URLRequest.developerInitiated(#URL("about:blank")))
webview.load(URLRequest.developerInitiated(URL(string: "about:blank")!))
getDefaultAgent(webView: webview) { [weak self] agent in
// Reference webview instance to keep it in scope and allow UA to be returned
_ = webview
Expand Down
66 changes: 1 addition & 65 deletions DuckDuckGo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -689,14 +689,6 @@
B652DF10287C2C1600C12A9C /* ContentBlocking.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9847BFFD27A2DDB400DB07AA /* ContentBlocking.swift */; };
B652DF12287C336E00C12A9C /* ContentBlockingUpdating.swift in Sources */ = {isa = PBXBuildFile; fileRef = B652DF11287C336E00C12A9C /* ContentBlockingUpdating.swift */; };
B652DF13287C373A00C12A9C /* ScriptSourceProviding.swift in Sources */ = {isa = PBXBuildFile; fileRef = B652DEFE287BF1FE00C12A9C /* ScriptSourceProviding.swift */; };
B6A26C042B98358B00DF9EAD /* Macros in Frameworks */ = {isa = PBXBuildFile; productRef = B6A26C032B98358B00DF9EAD /* Macros */; };
B6A26C062B98359A00DF9EAD /* Macros in Frameworks */ = {isa = PBXBuildFile; productRef = B6A26C052B98359A00DF9EAD /* Macros */; };
B6A26C082B9835A000DF9EAD /* Macros in Frameworks */ = {isa = PBXBuildFile; productRef = B6A26C072B9835A000DF9EAD /* Macros */; };
B6A26C0A2B9835A800DF9EAD /* Macros in Frameworks */ = {isa = PBXBuildFile; productRef = B6A26C092B9835A800DF9EAD /* Macros */; };
B6A26C0C2B9835AD00DF9EAD /* Macros in Frameworks */ = {isa = PBXBuildFile; productRef = B6A26C0B2B9835AD00DF9EAD /* Macros */; };
B6A26C0E2B9835B100DF9EAD /* Macros in Frameworks */ = {isa = PBXBuildFile; productRef = B6A26C0D2B9835B100DF9EAD /* Macros */; };
B6A26C102B9835B400DF9EAD /* Macros in Frameworks */ = {isa = PBXBuildFile; productRef = B6A26C0F2B9835B400DF9EAD /* Macros */; };
B6A26C122B9835B800DF9EAD /* Macros in Frameworks */ = {isa = PBXBuildFile; productRef = B6A26C112B9835B800DF9EAD /* Macros */; };
B6AD9E3628D4510A0019CDE9 /* ContentBlockerRulesManagerMock.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6AD9E3428D4510A0019CDE9 /* ContentBlockerRulesManagerMock.swift */; };
B6AD9E3728D4510A0019CDE9 /* ContentBlockingUpdatingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6AD9E3528D4510A0019CDE9 /* ContentBlockingUpdatingTests.swift */; };
B6AD9E3828D4512E0019CDE9 /* EmbeddedTrackerDataTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9801F08927E4B21100191874 /* EmbeddedTrackerDataTests.swift */; };
Expand Down Expand Up @@ -2709,15 +2701,13 @@
0202569029881ECA00E694E7 /* CocoaAsyncSocket in Frameworks */,
02025664298818B200E694E7 /* NetworkExtension.framework in Frameworks */,
4B470EE4299C6DFB0086EBDC /* Core.framework in Frameworks */,
B6A26C062B98359A00DF9EAD /* Macros in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
025CCFDF2582601C001CD5BB /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B6A26C0E2B9835B100DF9EAD /* Macros in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -2736,7 +2726,6 @@
853273B624FFE0BB00E3C778 /* WidgetKit.framework in Frameworks */,
0238E44F29C0FAA100615E30 /* FindInPageIOSJSSupport in Frameworks */,
3760DFED299315EF0045A446 /* Waitlist in Frameworks */,
B6A26C042B98358B00DF9EAD /* Macros in Frameworks */,
F1D43AFA2B99C1D300BAB743 /* BareBonesBrowserKit in Frameworks */,
F143C2EB1E4A4CD400CFDE3A /* Core.framework in Frameworks */,
4B2754EC29E8C7DF00394032 /* Lottie in Frameworks */,
Expand All @@ -2754,7 +2743,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B6A26C0A2B9835A800DF9EAD /* Macros in Frameworks */,
F486D3362506A037002D07D7 /* OHHTTPStubs in Frameworks */,
F486D3382506A225002D07D7 /* OHHTTPStubsSwift in Frameworks */,
4BE67B052B96B9AB007335F7 /* ContentBlocking in Frameworks */,
Expand Down Expand Up @@ -2787,7 +2775,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B6A26C102B9835B400DF9EAD /* Macros in Frameworks */,
1E1D8B632995143200C96994 /* OHHTTPStubs in Frameworks */,
1E1D8B652995143200C96994 /* OHHTTPStubsSwift in Frameworks */,
4BE67B012B96B741007335F7 /* Common in Frameworks */,
Expand All @@ -2799,7 +2786,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
B6A26C0C2B9835AD00DF9EAD /* Macros in Frameworks */,
F486D31D2506980E002D07D7 /* Swifter in Frameworks */,
85F21DC021123B03002631A6 /* Core.framework in Frameworks */,
);
Expand All @@ -2810,7 +2796,6 @@
buildActionMask = 2147483647;
files = (
98D4B7DF2944DDBD0068814D /* Core.framework in Frameworks */,
B6A26C122B9835B800DF9EAD /* Macros in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -2819,7 +2804,6 @@
buildActionMask = 2147483647;
files = (
4B948E2629DCCDB9002531FA /* Persistence in Frameworks */,
B6A26C082B9835A000DF9EAD /* Macros in Frameworks */,
98A50962294B48A400D10880 /* Bookmarks in Frameworks */,
1E60989B290009C700A508F9 /* Common in Frameworks */,
1E60989D290011E600A508F9 /* ContentBlocking in Frameworks */,
Expand Down Expand Up @@ -5701,7 +5685,6 @@
name = PacketTunnelProvider;
packageProductDependencies = (
0202568F29881ECA00E694E7 /* CocoaAsyncSocket */,
B6A26C052B98359A00DF9EAD /* Macros */,
);
productName = PacketTunnelProvider;
productReference = 02025662298818B100E694E7 /* PacketTunnelProvider.appex */;
Expand All @@ -5723,7 +5706,6 @@
);
name = FingerprintingUITests;
packageProductDependencies = (
B6A26C0D2B9835B100DF9EAD /* Macros */,
);
productName = FingerprintingUITests;
productReference = 025CCFE22582601C001CD5BB /* FingerprintingUITests.xctest */;
Expand Down Expand Up @@ -5785,7 +5767,6 @@
0238E44E29C0FAA100615E30 /* FindInPageIOSJSSupport */,
4B2754EB29E8C7DF00394032 /* Lottie */,
CB941A6D2B96AB08000F9E7A /* PrivacyDashboard */,
B6A26C032B98358B00DF9EAD /* Macros */,
F1D43AF92B99C1D300BAB743 /* BareBonesBrowserKit */,
);
productName = DuckDuckGo;
Expand Down Expand Up @@ -5814,7 +5795,6 @@
F115ED9B2B4EFC8E001A0453 /* TestUtils */,
4BE67B042B96B9AB007335F7 /* ContentBlocking */,
4BE67B062B96B9B0007335F7 /* Common */,
B6A26C092B9835A800DF9EAD /* Macros */,
);
productName = DuckDuckGoTests;
productReference = 84E341A61E2F7EFB00BDBA6F /* UnitTests.xctest */;
Expand Down Expand Up @@ -5880,7 +5860,6 @@
1E1D8B642995143200C96994 /* OHHTTPStubsSwift */,
4BE67B002B96B741007335F7 /* Common */,
4BE67B022B96B864007335F7 /* ContentBlocking */,
B6A26C0F2B9835B400DF9EAD /* Macros */,
);
productName = IntegrationTests;
productReference = 85D33FCB25C97B6E002B91A6 /* IntegrationTests.xctest */;
Expand All @@ -5903,7 +5882,6 @@
name = AtbUITests;
packageProductDependencies = (
F486D31C2506980E002D07D7 /* Swifter */,
B6A26C0B2B9835AD00DF9EAD /* Macros */,
);
productName = AtbIntegrationTests;
productReference = 85F21DAD210F5E32002631A6 /* AtbUITests.xctest */;
Expand All @@ -5925,7 +5903,6 @@
);
name = PerformanceTests;
packageProductDependencies = (
B6A26C112B9835B800DF9EAD /* Macros */,
);
productName = IntegrationTests;
productReference = 9825F9D7293F2DE900F220F2 /* PerformanceTests.xctest */;
Expand Down Expand Up @@ -5978,7 +5955,6 @@
D61CDA152B7CF77300A0FBB9 /* Subscription */,
D61CDA172B7CF78300A0FBB9 /* ZIPFoundation */,
858D009C2B9799FC004E5B4C /* History */,
B6A26C072B9835A000DF9EAD /* Macros */,
);
productName = Core;
productReference = F143C2E41E4A4CD400CFDE3A /* Core.framework */;
Expand Down Expand Up @@ -10044,7 +10020,7 @@
repositoryURL = "https://github.com/DuckDuckGo/BrowserServicesKit";
requirement = {
kind = exactVersion;
version = 122.1.1;
version = 122.2.0;
};
};
B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */ = {
Expand Down Expand Up @@ -10231,46 +10207,6 @@
package = 98A16C2928A11BDE00A6C003 /* XCRemoteSwiftPackageReference "BrowserServicesKit" */;
productName = Bookmarks;
};
B6A26C032B98358B00DF9EAD /* Macros */ = {
isa = XCSwiftPackageProductDependency;
package = B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
productName = Macros;
};
B6A26C052B98359A00DF9EAD /* Macros */ = {
isa = XCSwiftPackageProductDependency;
package = B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
productName = Macros;
};
B6A26C072B9835A000DF9EAD /* Macros */ = {
isa = XCSwiftPackageProductDependency;
package = B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
productName = Macros;
};
B6A26C092B9835A800DF9EAD /* Macros */ = {
isa = XCSwiftPackageProductDependency;
package = B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
productName = Macros;
};
B6A26C0B2B9835AD00DF9EAD /* Macros */ = {
isa = XCSwiftPackageProductDependency;
package = B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
productName = Macros;
};
B6A26C0D2B9835B100DF9EAD /* Macros */ = {
isa = XCSwiftPackageProductDependency;
package = B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
productName = Macros;
};
B6A26C0F2B9835B400DF9EAD /* Macros */ = {
isa = XCSwiftPackageProductDependency;
package = B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
productName = Macros;
};
B6A26C112B9835B800DF9EAD /* Macros */ = {
isa = XCSwiftPackageProductDependency;
package = B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
productName = Macros;
};
B6F997CB2B8F380A00476735 /* SwiftLintPlugin */ = {
isa = XCSwiftPackageProductDependency;
package = B6F997C22B8F374300476735 /* XCRemoteSwiftPackageReference "apple-toolbox" */;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
"kind" : "remoteSourceControl",
"location" : "https://github.com/DuckDuckGo/BrowserServicesKit",
"state" : {
"revision" : "8da10a2d3cbd3ca3284898896a0471d024a155ec",
"version" : "122.1.1"
"revision" : "4e05a46f0a9ce56f6d6379b79a92dc7a0182e027",
"version" : "122.2.0"
}
},
{
Expand Down
3 changes: 1 addition & 2 deletions DuckDuckGo/AutofillLoginDetailsViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import Core
import DDGSync
import DesignResourcesKit
import Foundation
import Macros
import SecureStorage
import SwiftUI

Expand Down Expand Up @@ -59,7 +58,7 @@ final class AutofillLoginDetailsViewModel: ObservableObject {
}

enum Constants {
static let privateEmailURL = #URL("https://duckduckgo.com/email")
static let privateEmailURL = URL(string: "https://duckduckgo.com/email")!
}

weak var delegate: AutofillLoginDetailsViewModelDelegate?
Expand Down
3 changes: 1 addition & 2 deletions DuckDuckGo/DesktopDownloadViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
//

import Foundation
import Macros
import UIKit

final class DesktopDownloadViewModel: ObservableObject {

static let defaultURL = #URL("https://duckduckgo.com/")
static let defaultURL = URL(string: "https://duckduckgo.com/")!
static let prefix = "https://"

private var platform: DesktopDownloadPlatform
Expand Down
3 changes: 1 addition & 2 deletions DuckDuckGo/FirewallManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import Foundation
import NetworkExtension
import BrowserServicesKit
import Common
import Macros

public protocol FirewallDelegate: AnyObject {
func statusDidChange(newStatus: NEVPNStatus)
Expand Down Expand Up @@ -81,7 +80,7 @@ public class FirewallManager: FirewallManaging {
config.requestCachePolicy = .reloadIgnoringLocalCacheData
config.urlCache = nil
let session = URLSession(configuration: config)
let url = #URL("https://bad_url")
let url = URL(string: "https://bad_url")!

os_log("[INFO] Calling dummy URL to force VPN", log: FirewallManager.apptpLog, type: .debug)
_ = try? await session.data(from: url)
Expand Down
5 changes: 2 additions & 3 deletions DuckDuckGo/RemoteMessageRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,16 @@
import BrowserServicesKit
import Core
import Foundation
import Macros
import Networking
import RemoteMessaging

public struct RemoteMessageRequest {

private var endpoint: URL {
#if DEBUG
return #URL("https://raw.githubusercontent.com/duckduckgo/remote-messaging-config/main/samples/ios/sample1.json")
return URL(string: "https://raw.githubusercontent.com/duckduckgo/remote-messaging-config/main/samples/ios/sample1.json")!
#else
return #URL("https://staticcdn.duckduckgo.com/remotemessaging/config/v1/ios-config.json")
return URL(string: "https://staticcdn.duckduckgo.com/remotemessaging/config/v1/ios-config.json")!
#endif
}

Expand Down
Loading
Loading