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

Add .html support #3867

Merged
merged 12 commits into from
Jul 22, 2022
Merged

Add .html support #3867

merged 12 commits into from
Jul 22, 2022

Conversation

natemoo-re
Copy link
Member

@natemoo-re natemoo-re commented Jul 8, 2022

Changes

  • Adds .html support to Astro!
  • .html files can be used as components or pages
  • .html files accept content for any slot elements (default or named)
  • .html files can opt-out of slot overloading by using the is:inline attribute
  • Referencing relative assets from an .html file is not supported, assets must be in public/
    • Use an .astro file with imports if you need this!
  • .html files treat script and style elements as is:inline.
    • Use an .astro file if you need advanced script/style behavior.
  • .html files treat self-closing elements according to the HTML specification (/> is ignored.)
    • Use an .astro file if you want self-closing element support for every element.

Testing

Test coverage added

Docs

TODO

@changeset-bot
Copy link

changeset-bot bot commented Jul 8, 2022

🦋 Changeset detected

Latest commit: 41820f9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages
Name Type
astro Patch
@e2e/astro-component Patch
@e2e/error-react-spectrum Patch
@e2e/error-sass Patch
@e2e/errors Patch
@e2e/lit-component Patch
@e2e/preact-component Patch
@e2e/react-component Patch
@e2e/solid-component Patch
@e2e/svelte-component Patch
@e2e/e2e-tailwindcss Patch
@e2e/ts-resolution Patch

Not sure what this means? Click here to learn what changesets are.

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

@github-actions github-actions bot added pkg: astro Related to the core `astro` package (scope) pkg: integration Related to any renderer integration (scope) labels Jul 8, 2022
@Princesseuh
Copy link
Member

Princesseuh commented Jul 14, 2022

For TypeScript purpose, an accessible module declaration will be needed so there's no editor errors when importing .html file, ex:

declare module "*.html" {
  const content: string;
  export default content;
}

It can be inside astro-env.d.ts if you don't mind there being no type errors even when the integration isn't installed, otherwise it might require a change in the language server to load types from integrations in Astro files (without requiring the user to explicitly add it to types inside their tsconfig.json)

@natemoo-re natemoo-re mentioned this pull request Jul 21, 2022
20 tasks
@github-actions github-actions bot removed the pkg: integration Related to any renderer integration (scope) label Jul 21, 2022
@natemoo-re natemoo-re merged commit 7250e4e into main Jul 22, 2022
@natemoo-re natemoo-re deleted the feat/html branch July 22, 2022 15:32
@astrobot-houston astrobot-houston mentioned this pull request Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg: astro Related to the core `astro` package (scope)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants