PackageTrack

npm · #4525 most downloaded on npm

@astrojs/compiler

4.0.0withastro/compiler

Astro’s [Go](https://golang.org/) + WASM compiler.

Release timeline

373 releases since 2021
20222023202420252026

Releases

  1. 0.28.121 Oct 2022
    Release notes

    Patch Changes

    • aac8c89: Fix end tag sourcemappings for TSX mode
    • d7f3288: TSX: Improve self-closing tag behavior and mappings
    • 75dd7cc: Fix spread attribute mappings
    Open source →
  2. 0.28.020 Oct 2022
    Release notes

    Minor Changes

    • 5da0dc2: Add resolvePath option to control hydration path resolution
    • e816a61: Remove metadata export if resolvePath option provided
    Open source →
  3. 0.27.214 Oct 2022
    Release notes

    Patch Changes

    • 959f96b: Fix "missing sourcemap" issue
    • 94f6f3e: Fix edge case with multi-line comment usage
    • 85a654a: Fix parse causing a compiler panic when a component with a client directive was imported but didn't have a matching import
    • 5e32cbe: Improvements to TSX output
    Open source →
  4. 0.27.110 Oct 2022
    Release notes

    Patch Changes

    • cc9f174: fixed regression caused by #546
    Open source →
  5. 0.27.06 Oct 2022
    Release notes

    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
    Open source →
  6. 0.26.16 Oct 2022
    Release notes

    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
    Open source →
  7. 0.26.05 Oct 2022
    Release notes

    Minor Changes

    • 0be58ab: Improve sourcemap support for TSX output

    Patch Changes

    • e065e29: Prevent head injection from removing script siblings
    Open source →
  8. 0.25.230 Sept 2022
    Release notes

    Patch Changes

    • 3a51b8e: Ensure that head injection occurs if there is only a hoisted script
    Open source →
  9. 0.25.128 Sept 2022
    Release notes

    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
    Open source →
  10. 0.25.028 Sept 2022
    Release notes

    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
    Open source →
  11. 0.24.08 Sept 2022
    Release notes

    Minor Changes

    • 6ebcb4f: Allow preprocessStyle to return an error

    Patch Changes

    • abda605: Include filename when calculating scope
    Open source →
  12. 0.23.56 Sept 2022
    Release notes

    Patch Changes

    • 6bc8e0b: Prevent import assertion from being scanned too soon
    Open source →
  13. 0.23.424 Aug 2022
    Release notes

    Patch Changes

    • 3b9f0d2: Remove css print escape for experimentalStaticExtraction
    Open source →
  14. 0.23.312 Aug 2022
    Release notes

    Patch Changes

    • 7693d76: Fix resolution of .jsx modules
    Open source →
  15. 0.23.212 Aug 2022
    Release notes

    Patch Changes

    • 167ad21: Improve handling of namespaced components when they are multiple levels deep
    • 9283258: Fix quotations in pre-quoted attributes
    • 76fcef3: Better handling for imports which use special characters
    Open source →
  16. 0.23.15 Aug 2022
    Release notes

    Patch Changes

    • 79376f3: Fix regression with expression rendering
    Open source →
  17. 0.23.05 Aug 2022
    Release notes

    Minor Changes

    • d8448e2: Prevent printing the doctype in the JS output

    Patch Changes

    • a28c3d8: Fix handling of unbalanced quotes in expression attributes
    • 28d1d4d: Fix handling of TS generics inside of expressions
    • 356d3b6: Prevent wraping module scripts with scope
    Open source →
  18. 0.22.126 Jul 2022
    Release notes

    Patch Changes

    • 973103c: Prevents unescaping attribute expressions
    Open source →
  19. 0.22.022 Jul 2022
    Release notes

    Minor Changes

    • 558c9dd: Generate a stable scoped class that does NOT factor in local styles. This will allow us to safely do style HMR without needing to update the DOM as well.
    • c19cd8c: Update Astro's CSS scoping algorithm to implement zero-specificity scoping, according to RFC0012.
    Open source →
  20. 0.21.021 Jul 2022
    Release notes

    Minor Changes

    • 8960d82: New handling for define:vars scripts and styles

    Patch Changes

    • 4b318d5: Do not attempt to hoist styles or scripts inside of <noscript>
    Open source →
  21. 0.20.020 Jul 2022
    Release notes

    Minor Changes

    • 48d33ff: Removes compiler special casing for the Markdown component
    • 4a5352e: Removes limitation where imports/exports must be at the top of an .astro file. Fixes various edge cases around getStaticPaths hoisting.

    Patch Changes

    • 245d73e: Add support for HTML minification by passing compact: true to transform.
    • 3ecdd24: Update TSX output to also generate TSX-compatible code for attributes containing dots
    Open source →
  22. 0.20.0-next.215 Jul 2022pre-release

    Nothing published for this version

  23. 0.20.0-next.115 Jul 2022pre-release

    Nothing published for this version

  24. 0.20.0-next.014 Jul 2022pre-release

    Nothing published for this version

  25. 0.19.013 Jul 2022
    Release notes

    Minor Changes

    • fcb4834: Removes fallback for the site configuration

    Patch Changes

    • 02add77: Fixes many edge cases around tables when used with components, slots, or expressions
    • b23dd4d: Fix handling of unmatched close brace in template literals
    • 9457a91: Fix issue with { in template literal attributes
    • c792161: Fix nested expression handling with a proper expression tokenizer stack
    Open source →
  26. 0.19.0-pre.012 Jul 2022pre-release

    Nothing published for this version

  27. 0.18.211 Jul 2022
    Release notes

    Patch Changes

    • f8547a7: Revert #448 for now
    Open source →
  28. 0.18.111 Jul 2022
    Release notes

    Patch Changes

    • aff2f23: Warning on client: usage on scripts
    Open source →
  29. 0.18.06 Jul 2022
    Release notes

    Minor Changes

    • 4b02776: Fix handling of slot attribute used inside of expressions

    Patch Changes

    • 62d2a8e: Properly handle nested expressions that return multiple elements
    • 571d6b9: Ensure html and body elements are scoped
    Open source →
  30. 0.17.127 Jun 2022
    Release notes

    Patch Changes

    • 3885217: Support <slot is:inline /> and preserve slot attribute when not inside component
    • ea94a26: Fix issue with fallback content inside of slots
    Open source →
  31. 0.17.023 Jun 2022
    Release notes

    Minor Changes

    • 3a9d166: Add renderHead injection points
    Open source →
  32. 0.17.0-pre.422 Jun 2022pre-release

    Nothing published for this version

  33. 0.17.0-pre.322 Jun 2022pre-release

    Nothing published for this version

  34. 0.17.0-pre.222 Jun 2022pre-release

    Nothing published for this version

  35. 0.17.0-pre.122 Jun 2022pre-release

    Nothing published for this version

  36. 0.17.0-pre.022 Jun 2022pre-release

    Nothing published for this version

  37. 0.16.120 Jun 2022
    Release notes

    Patch Changes

    • 9fcc43b: Build JS during the release
    Open source →
  38. 0.16.020 Jun 2022
    Release notes

    Minor Changes

    • 470efc0: Adds component metadata to the TransformResult

    Patch Changes

    • c104d4f: Fix #418: duplicate text when only text
    Open source →
  39. 0.16.0-metadata-preview17 Jun 2022pre-release

    Nothing published for this version

  40. 0.15.231 May 2022
    Release notes

    Patch Changes

    • f951822: Fix wasm parse to save attribute namespace
    • 5221e09: Fix serialize spread attribute
    Open source →
  41. 0.15.2-pre.027 May 2022pre-release

    Nothing published for this version

  42. 0.15.124 May 2022
    Release notes

    Patch Changes

    • 26cbcdb: Prevent side-effectual CSS imports from becoming module metadata
    Open source →
  43. 0.15.023 May 2022
    Release notes

    Minor Changes

    • 702e848: Trailing space at the end of Astro files is now stripped from Component output.

    Patch Changes

    • 3a1a24b: Fix long-standing bug where a class attribute inside of a spread prop will cause duplicate class attributes
    • 62faceb: Fixes an issue where curly braces in <math> elements would get parsed as expressions instead of raw text.
    Open source →
  44. 0.14.320 May 2022
    Release notes

    Patch Changes

    • 6177620: Fix edge case with expressions inside of tables
    • 79b1ed6: Provides a better error message when we can't match client:only usage to an import statement
    • a4e1957: Fix Astro scoping when class:list is used
    • fda859a: Fix json escape
    Open source →
  45. 0.14.221 Apr 2022
    Release notes

    Patch Changes

    • 6f30e2e: Fix edge case with nested expression inside <>
    • 15e3ff8: Fix panic when using a <slot /> in head
    • c048567: Fix edge case with select elements and expression children
    • 13d2fc2: Fix #340, fixing behavior of content after an expression inside of <select>
    • 9e37a72: Fix issue when multiple client-only components are used
    • 67993d5: Add support for block comment only expressions, block comment only shorthand attributes and block comments in shorthand attributes
    • 59fbea2: Fix #343, edge case with <tr> inside component
    • 049dadf: Fix usage of expressions inside caption and colgroup elements
    Open source →
  46. 0.14.12 Apr 2022
    Release notes

    Patch Changes

    • 1a82892: Fix bug with <script src> not being hoisted
    Open source →
  47. 0.14.02 Apr 2022
    Release notes

    Minor Changes

    • c0da4fe: Implements RFC0016, the new script and style behavior.
    Open source →
  48. 0.13.231 Mar 2022
    Release notes

    Patch Changes

    • 014370d: Fix issue with named slots in <head> element
    • da831c1: Fix handling of RegExp literals in frontmatter
    Open source →
  49. 0.13.121 Mar 2022
    Release notes

    Patch Changes

    • 2f8334c: Update parse and serialize functions to combine attributes and directives, fix issue with serialize not respecting attributes.
    • b308955: Add self-close option to serialize util
    Open source →
  50. 0.13.018 Mar 2022
    Release notes

    Minor Changes

    • ce3f1a5: Update CSS parser to use esbuild, adding support for CSS nesting, @container, @layer, and other modern syntax features

    Patch Changes

    • 24a1185: Parser: Always output the children property in an element node, even if it has no children
    Open source →
  51. 0.12.114 Mar 2022
    Release notes

    Patch Changes

    • 097ac47: Parser: Always output the attribute property in an element node, even if empty
    • ad62437: Add serialize util
    • eb7eb95: Parse: fix escaping of & characters in AST output
    Open source →
  52. 0.12.011 Mar 2022
    Release notes

    Minor Changes

    • c6dd41d: Do not render implicit tags created during the parsing process
    • c6dd41d: Remove "as" option, treats all documents as fragments that generate no implicit tags
    • c6dd41d: Add parse function which generates an AST
    • c6dd41d: Adds support for Astro.self (as accepted in the Recursive Components RFC).

    Patch Changes

    • c6dd41d: Add fragment node types to AST definitions, expose Fragment helper to utils
    • c6dd41d: Adds metadata on client:only components
    • c6dd41d: Expose AST types via @astrojs/compiler/types
    • c6dd41d: Export ./types rather than ./types.d.ts
    • c6dd41d: Fix edge case with Fragment parsing in head, add fragment node to AST output
    • c6dd41d: Fix <slot> behavior inside of head
    • c6dd41d: Improve head injection behavior
    • ef0b4b3: Move typescript dependency to development dependencies, as it is not needed in the package runtime.
    • c6dd41d: Update exposed types
    • c6dd41d: Remove usage of escapeHTML util
    • c6dd41d: Export all types from shared types
    • c6dd41d: Fix head behavior and a bug related to ParseFragment
    • c6dd41d: Adds a warning when using an expression with a hoisted script
    Open source →
  53. 0.12.0-next.99 Mar 2022pre-release
    Release notes

    Patch Changes

    • 95ec808: Fix <slot> behavior inside of head
    • 95ec808: Remove usage of escapeHTML util
    Open source →
  54. 0.12.0-next.82 Mar 2022pre-release
    Release notes

    Patch Changes

    • 4497628: Improve head injection behavior
    Open source →
  55. 0.12.0-next.71 Mar 2022pre-release
    Release notes

    Patch Changes

    • e26b9d6: Fix edge case with Fragment parsing in head, add fragment node to AST output
    Open source →
  56. 0.12.0-next.61 Mar 2022pre-release
    Release notes

    Patch Changes

    • 37ef1c1: Fix head behavior and a bug related to ParseFragment
    Open source →
  57. 0.12.0-next.528 Feb 2022pre-release
    Release notes

    Patch Changes

    • 97cf66b: Adds metadata on client:only components
    Open source →
  58. 0.12.0-next.425 Feb 2022pre-release
    Release notes

    Patch Changes

    • e2061dd: Export all types from shared types
    Open source →
  59. 0.12.0-next.325 Feb 2022pre-release
    Release notes

    Patch Changes

    • ef69b74: Export ./types rather than ./types.d.ts
    Open source →
  60. 0.12.0-next.225 Feb 2022pre-release
    Release notes

    Patch Changes

    • 073b0f1: Adds a warning when using an expression with a hoisted script
    Open source →