Releases: withastro/compiler
Releases · withastro/compiler
@astrojs/[email protected]
@astrojs/[email protected]
Minor Changes
-
c770e7b: The compiler will now return
diagnosticsand unique error codes to be handled by the consumer. For example:import type { DiagnosticSeverity, DiagnosticCode } from '@astrojs/compiler/types'; import { transform } from '@astrojs/compiler'; async function run() { const { diagnostics } = await transform(file, opts); function log(severity: DiagnosticSeverity, message: string) { switch (severity) { case DiagnosticSeverity.Error: return console.error(message); case DiagnosticSeverity.Warning: return console.warn(message); case DiagnosticSeverity.Information: return console.info(message); case DiagnosticSeverity.Hint: return console.info(message); } } for (const diagnostic of diagnostics) { let message = diagnostic.text; if (diagnostic.hint) { message += `\n\n[hint] ${diagnostic.hint}`; } // Or customize messages for a known DiagnosticCode if (diagnostic.code === DiagnosticCode.ERROR_UNMATCHED_IMPORT) { message = `My custom message about an unmatched import!`; } log(diagnostic.severity, message); } }
Patch Changes
- 0b24c24: Implement automatic typing for Astro.props in the TSX output
@astrojs/[email protected]
Patch Changes
- 920898c: Handle edge case with
noscripttags - 8ee78a6: handle slots that contains the head element
- 244e43e: Do not hoist import inside object
- b8cd954: Fix edge case with line comments and export hoisting
- 52ebfb7: Fix parse/tsx output to gracefully handle invalid HTML (style outside of body, etc)
- 884efc6: Fix edge case with multi-line export hoisting
@astrojs/[email protected]
@astrojs/[email protected]
Patch Changes
- 3a51b8e: Ensure that head injection occurs if there is only a hoisted script
@astrojs/[email protected]
@astrojs/[email protected]
@astrojs/[email protected]
@astrojs/[email protected]
Patch Changes
- 6bc8e0b: Prevent import assertion from being scanned too soon
@astrojs/[email protected]
Patch Changes
- 3b9f0d2: Remove css print escape for experimentalStaticExtraction