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
I18n extractor avoid standalone filesystem api #39006
I18n extractor avoid standalone filesystem api #39006
Conversation
This commit marks the functions and classes that are used by the CLI.
These free standing functions rely upon the "current" `FileSystem`, but it is safer to explicitly pass the `FileSystem` into functions or classes that need it.
740b85e
to
a9e0105
Compare
These free standing functions rely upon the "current" `FileSystem`, but it is safer to explicitly pass the `FileSystem` into functions or classes that need it. Fixes angular#38711
a9e0105
to
ca89d35
Compare
I testing the fix and this does indeed address the sourcemap issue on Windows. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…tractor FS This will be needed when the changes in angular/angular#39006 is merged.
@@ -7,17 +7,19 @@ | |||
*/ | |||
import {encode} from 'sourcemap-codec'; | |||
|
|||
import {absoluteFrom} from '../../file_system'; | |||
import {absoluteFrom, FileSystem, getFileSystem} from '../../file_system'; | |||
import {runInEachFileSystem} from '../../file_system/testing'; | |||
import {RawSourceMap} from '../src/raw_source_map'; | |||
import {SegmentMarker} from '../src/segment_marker'; | |||
import {computeStartOfLinePositions, ensureOriginalSegmentLinks, extractOriginalSegments, findLastMappingIndexBefore, Mapping, parseMappings, SourceFile} from '../src/source_file'; | |||
|
|||
runInEachFileSystem(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should consider having runInEachFileSystem
pass the file system instance currently under test in the callback. From a quick search, this would remove the need for a large amount of getFileSystem
calls.
packages/compiler-cli/ngcc/test/dependencies/module_resolver_spec.ts
alone has almost 20 calls to getFileSystem
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I was thinking exactly that while working on this. But I felt it was too large a change for this PR. Let's do it in a follow up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed.
FYI, this change does not require g3 presubmit since we do not sync the |
This commit marks the functions and classes that are used by the CLI. PR Close #39006
…tractor FS This will be needed when the changes in angular/angular#39006 is merged. (cherry picked from commit 1c4d358) Closes: #19005
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This should fix Windows source-mapping in the i18n extraction integration with CLI.
I have tried to ensure that the public API items are backward compatible with what the CLI currently uses.
Ideally the CLI will switch over to providing the file-system object where needed but I am not sure if this is entirely necessary to fix the reported problem.
FIxes #38711