Conversation
There was a problem hiding this comment.
Are these also emitted into the .d.ts files that are shipped to NPM? If so, would the reference directives require those modules to be present in a user's node_modules tree? The @types/babel__* packages aren't deps of localize, so they may not be available.
There was a problem hiding this comment.
Doesn't look like it. Here's what the dist/packages-dist/localize/tools/index.d.ts looks like when it's built with TS 5.3:
export { DiagnosticHandlingStrategy, Diagnostics } from './src/diagnostics';
export { checkDuplicateMessages } from './src/extract/duplicates';
export { MessageExtractor } from './src/extract/extraction';
export { ArbTranslationSerializer } from './src/extract/translation_files/arb_translation_serializer';
export { SimpleJsonTranslationSerializer } from './src/extract/translation_files/json_translation_serializer';
export { LegacyMessageIdMigrationSerializer } from './src/extract/translation_files/legacy_message_id_migration_serializer';
export { Xliff1TranslationSerializer } from './src/extract/translation_files/xliff1_translation_serializer';
export { Xliff2TranslationSerializer } from './src/extract/translation_files/xliff2_translation_serializer';
export { XmbTranslationSerializer } from './src/extract/translation_files/xmb_translation_serializer';
export { buildLocalizeReplacement, isGlobalIdentifier, translate, unwrapExpressionsFromTemplateLiteral, unwrapMessagePartsFromLocalizeCall, unwrapMessagePartsFromTemplateLiteral, unwrapSubstitutionsFromLocalizeCall } from './src/source_file_utils';
export { makeEs2015TranslatePlugin } from './src/translate/source_files/es2015_translate_plugin';
export { makeEs5TranslatePlugin } from './src/translate/source_files/es5_translate_plugin';
export { makeLocalePlugin } from './src/translate/source_files/locale_plugin';
export { ArbTranslationParser } from './src/translate/translation_files/translation_parsers/arb_translation_parser';
export { SimpleJsonTranslationParser } from './src/translate/translation_files/translation_parsers/simple_json_translation_parser';
export { Xliff1TranslationParser } from './src/translate/translation_files/translation_parsers/xliff1_translation_parser';
export { Xliff2TranslationParser } from './src/translate/translation_files/translation_parsers/xliff2_translation_parser';
export { XtbTranslationParser } from './src/translate/translation_files/translation_parsers/xtb_translation_parser';
There was a problem hiding this comment.
Actually nevermind, they do get emitted into some of those re-exported files. @devversion should we list these packages as dependencies?
There was a problem hiding this comment.
Even before this update, this dependency already existed (because @babel/core is imported in the .d.ts). In addition there is also the ESM explicit extension issue with localize/tools (something on the backburner).
I think we can safely add the type dependency, in case some people check the types (skipLibCheck = false). I wonder if someone has a reference to the TS commit that changed this behavior.
There was a problem hiding this comment.
Neither of these packages expose global types right? If so, then I think it should be safe to include the dependencies. I'm not very familiar with with <reference type="..." /> or how Babel interacts with @angular/localize though. @clydin, do you have any concerns with this?
Updates the repo to support TypeScript 5.3 and resolve any issues. Fixes include: * Updating usages of TS compiler APIs to match their new signatures. * In TS 5.3 negative numbers are represented as `PrefixUnaryExpression` instead of `NumericExpression`. These changes update all usages to account for it since passing a negative number into the old APIs results in a runtime error.
|
I've updated |
atscott
left a comment
There was a problem hiding this comment.
reviewed-for: public-api
AndrewKushnir
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
There was a problem hiding this comment.
Neither of these packages expose global types right? If so, then I think it should be safe to include the dependencies. I'm not very familiar with with <reference type="..." /> or how Babel interacts with @angular/localize though. @clydin, do you have any concerns with this?
|
This PR was merged into the repository by commit 94096c6. |
|
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. |
Updates the repo to support TypeScript 5.3 and resolve any issues. Fixes include: * Updating usages of TS compiler APIs to match their new signatures. * In TS 5.3 negative numbers are represented as `PrefixUnaryExpression` instead of `NumericExpression`. These changes update all usages to account for it since passing a negative number into the old APIs results in a runtime error. PR Close angular#52572
Updates the repo to support TypeScript 5.3 and resolve any issues. Fixes include:
PrefixUnaryExpressioninstead ofNumericExpression. These changes update all usages to account for it since passing a negative number into the old APIs results in a runtime error.