Skip to content
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

Update Astro docs to use v0.21 #1738

Merged
merged 10 commits into from
Nov 11, 2021
Merged

Update Astro docs to use v0.21 #1738

merged 10 commits into from
Nov 11, 2021

Conversation

jonathantneal
Copy link
Contributor

@jonathantneal jonathantneal commented Nov 4, 2021

Changes

This updates the Astro docs site to use Astro v0.21.

Testing

docs site only

Docs

docs site only

@changeset-bot
Copy link

changeset-bot bot commented Nov 4, 2021

⚠️ No Changeset found

Latest commit: 4dd4c0b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@jonathantneal
Copy link
Contributor Author

jonathantneal commented Nov 4, 2021

The issue may be in how Astro is handling Vite aliases.

cc @natemoo-re

Example

// astro.config.mjs
export default {
  renderers: [],
  vite: {
    resolve: {
      alias: {
        '~': './src',
      },
    },
  },
}
---
layout: ~/layouts/MainLayout.astro
title: Getting Started
description: A basic intro to Astro.
---

Astro is a modern static site builder.
---
// src/layouts/MainLayout.astro
---
<html>
  <head>
  </head>
  <body>
    <slot />
  </body>
</html>

https://stackblitz.com/edit/github-etyrwp?file=src%2Flayouts%2FMainLayout.astro&on=stackblitz

Error when evaluating SSR module /@fs/home/projects/github-etyrwp/src/pages/getting-started.md:
ENOENT: no such file or directory, open '/src/layouts/MainLayout.astro'

Example (using JS)

<!-- src/pages/index.astro -->
<script type="module" src={Astro.resolve('../scripts/script-a.js')} />
// src/scripts/script-a.js
import fn from '~/components/script-b.js'

fn()
// src/scripts/script-b.js
export default function Fn() {
  document.title = 'Component loaded.'
}
400 http://localhost:3000/@id/src/components/script-b.js net::ERR_ABORTED 404 (Not Found)

https://stackblitz.com/edit/github-hp5d6g?file=src%2Fpages%2Findex.astro&on=stackblitz

@jonathantneal jonathantneal changed the title update docs site to leverage astro v0.21 Update Astro docs to use v0.21 Nov 5, 2021
@jonathantneal jonathantneal marked this pull request as ready for review November 5, 2021 14:36
@jonathantneal jonathantneal requested a review from a team as a code owner November 5, 2021 14:36
@drwpow
Copy link
Member

drwpow commented Nov 8, 2021

Is the PR description up-to-date? Is there anything still blocking this (the SVG issue has been fixed in the compiler right)?

Copy link
Contributor

@jasikpark jasikpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! I'm excited to get the docs & www working w/ v0.21

(I assume there's still a few bugs tho)

@natemoo-re natemoo-re added this to the v0.21 milestone Nov 10, 2021
@natemoo-re natemoo-re mentioned this pull request Nov 10, 2021
@jonathantneal jonathantneal requested a review from drwpow November 11, 2021 02:35
@jonathantneal jonathantneal merged commit e0c3318 into withastro:main Nov 11, 2021
@jonathantneal jonathantneal deleted the jn.update-docs-site branch November 11, 2021 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants