@@ -50,15 +50,13 @@ class BinderImp implements Binder {
5050 private project : Project ;
5151 private dependencies : Record < string , ReferenceableSymbol > ;
5252 private staticHelpers : Map < string , StaticHelperMetadata > ;
53- private useSubpathImports : boolean ;
5453
5554 constructor ( project : Project , options : BinderOptions = { } ) {
5655 this . project = project ;
5756
5857 provideDependencies ( options . dependencies ) ;
5958 this . staticHelpers = options . staticHelpers ?? new Map ( ) ;
6059 this . dependencies = useDependencies ( ) ;
61- this . useSubpathImports = options . useSubpathImports ?? false ;
6260 }
6361
6462 trackDeclaration ( refkey : unknown , name : string , sourceFile : SourceFile ) : string {
@@ -185,27 +183,6 @@ class BinderImp implements Binder {
185183 return importSpecifier ;
186184 }
187185
188- /**
189- * Returns the #platform/ subpath import specifier for a static helper file
190- * that has a polyfill variant (-browser.mts or -react-native.mts sibling),
191- * or undefined if subpath imports are disabled or no variant exists.
192- * e.g. "src/static-helpers/serialization/get-binary-response.ts"
193- * -> "#platform/static-helpers/serialization/get-binary-response"
194- */
195- private getPlatformImportSpecifier ( declarationSourceFile : SourceFile ) : string | undefined {
196- if ( ! this . useSubpathImports ) return undefined ;
197- const filePath = declarationSourceFile . getFilePath ( ) ;
198- const srcIndex = filePath . indexOf ( "/src/" ) ;
199- if ( srcIndex === - 1 ) return undefined ;
200- // Check if a -browser.mts or -react-native.mts sibling exists
201- const basePath = filePath . replace ( / \. t s $ / , "" ) ;
202- const hasBrowserVariant = this . project . getSourceFile ( basePath + "-browser.mts" ) ;
203- const hasReactNativeVariant = this . project . getSourceFile ( basePath + "-react-native.mts" ) ;
204- if ( ! hasBrowserVariant && ! hasReactNativeVariant ) return undefined ;
205- const relativePath = filePath . substring ( srcIndex + "/src/" . length ) ;
206- return "#platform/" + relativePath . replace ( / \. t s $ / , "" ) ;
207- }
208-
209186 /**
210187 * Applies all tracked imports to their respective source files.
211188 */
@@ -316,9 +293,7 @@ class BinderImp implements Binder {
316293
317294 if ( file !== declarationSourceFile ) {
318295 this . trackReference ( declarationKey , file ) ;
319- // Use #platform/ subpath import specifier for static helpers in warp packages
320- const platformSpecifier = this . getPlatformImportSpecifier ( declarationSourceFile ) ;
321- const importTarget = platformSpecifier ?? declarationSourceFile ;
296+ const importTarget = declarationSourceFile ;
322297 const importDec = this . addImport ( file , importTarget , name ) ;
323298 name = importDec . alias ?? name ;
324299 }
0 commit comments