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

Improve type output of sourcemaps #5578

Closed
ArnaudBarre opened this issue Sep 7, 2024 · 0 comments · Fixed by #5657
Closed

Improve type output of sourcemaps #5578

ArnaudBarre opened this issue Sep 7, 2024 · 0 comments · Fixed by #5657
Assignees
Labels
C-enhancement Category - New feature or request

Comments

@ArnaudBarre
Copy link
Contributor

ArnaudBarre commented Sep 7, 2024

Currently OXC outputs this for sourcemap types:

export interface SourceMap {
  file?: string
  mappings?: string
  sourceRoot?: string
  sources?: Array<string | undefined | null>
  sourcesContent?: Array<string | undefined | null>
  names?: Array<string>
}

Looking at the code, I think this more because the input type is reused as the output type

Currently Rollup/Vite requires this as a source map input:

export interface ExistingRawSourceMap {
	file?: string;
	mappings: string;
	names: string[];
	sourceRoot?: string;
	sources: string[];
	sourcesContent?: string[];
	version: number;
	x_google_ignoreList?: number[];
}

Having this be compatible will make it easier to write a transform plugin for Rollup/Vite that uses OXC

Note the required version: number; which can probably be hardcoded to 3 when serializing.

@ArnaudBarre ArnaudBarre added the C-enhancement Category - New feature or request label Sep 7, 2024
@Boshen Boshen self-assigned this Sep 7, 2024
Boshen added a commit that referenced this issue Sep 9, 2024
Boshen added a commit that referenced this issue Sep 9, 2024
@Boshen Boshen closed this as completed Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants