Skip to content

Releases: withastro/compiler

@astrojs/[email protected]

10 Oct 17:53
8f9c91b

Choose a tag to compare

Patch Changes

@astrojs/[email protected]

06 Oct 20:14
7977ab1

Choose a tag to compare

Minor Changes

  • c770e7b: The compiler will now return diagnostics and 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]

06 Oct 19:38
15ec06c

Choose a tag to compare

Patch Changes

  • 920898c: Handle edge case with noscript tags
  • 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]

05 Oct 13:42
57dc93a

Choose a tag to compare

Minor Changes

  • 0be58ab: Improve sourcemap support for TSX output

Patch Changes

  • e065e29: Prevent head injection from removing script siblings

@astrojs/[email protected]

30 Sep 15:48
e4cf5dc

Choose a tag to compare

Patch Changes

  • 3a51b8e: Ensure that head injection occurs if there is only a hoisted script

@astrojs/[email protected]

28 Sep 22:34
f65827f

Choose a tag to compare

Patch Changes

  • 41fae67: Do not scope empty style blocks
  • 1ab8280: fix(#517): fix edge case with TypeScript transform
  • a3678f9: Fix import.meta.env usage above normal imports

@astrojs/[email protected]

28 Sep 19:53
c764c6b

Choose a tag to compare

Minor Changes

  • 6446ea3: Make Astro styles being printed after user imports

Patch Changes

  • 51bc60f: Fix edge cases with getStaticPaths where valid JS syntax was improperly handled

@astrojs/[email protected]

08 Sep 12:41
4d815f1

Choose a tag to compare

Minor Changes

  • 6ebcb4f: Allow preprocessStyle to return an error

Patch Changes

  • abda605: Include filename when calculating scope

@astrojs/[email protected]

06 Sep 22:06
0944bed

Choose a tag to compare

Patch Changes

  • 6bc8e0b: Prevent import assertion from being scanned too soon

@astrojs/[email protected]

24 Aug 08:53
e52ba81

Choose a tag to compare

Patch Changes

  • 3b9f0d2: Remove css print escape for experimentalStaticExtraction