Commit graph

277 commits

Author SHA1 Message Date
Fred K. Schott
2b7b626629
update lockfile (#3828) 2022-07-07 12:06:56 -07:00
Nate Moore
5afb807688
Fix slot attribute inside expressions (#3837)
* fix: use slots inside expressions

* test: add test for conditional named slots

* test: fix incorrect test fixture

* chore: update `@astrojs/compiler`

* chore: add test coverage for `switch`

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-07 13:23:51 -05:00
Fred K. Schott
eedb32c797
detect package manager and improve types (#3847) 2022-07-07 11:12:31 -07:00
Nate Moore
0e01e0bb58
Upgrade to pnpm@7.4.1, remove patch-package (#3747)
* chore: upgrade to pnpm@7.4.0, remove `patch-package`

* chore: update contributing

* chore: pnpm@7.4.1

* chore: bump to pnpm@7.5.0

Co-authored-by: Nate Moore <nate@astro.build>
2022-07-07 12:52:53 -05:00
Fred K. Bot
568960f175
[ci] release (#3818)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-06 21:00:18 -04:00
Fred K. Bot
08d068496d
[ci] release (#3800)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 15:56:49 -05:00
Fred K. Bot
94143fcdba
[ci] release (#3789)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 17:43:26 +00:00
Fred K. Bot
deab65d7b3
[ci] update lockfile (#3786)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-07-01 08:50:18 -07:00
Tony Sullivan
e8593e7ead
Adds an @astrojs/image integration for optimizing images (#3694)
* initial commit

* WIP: starting to define interfaces for images and transformers

* WIP: basic sharp service to test out the API setup

* adding a few tests for sharp.toImageSrc

* Adding tests for sharp.parseImageSrc

* hooking up basic SSR support

* updating image services to return width/height

* simplifying config setup for v1

* hooking up basic SSR + SSG support (dev & build)

* refactor: a bit of code cleanup and commenting

* WIP: migrating local files to ESM + vite plugin

* WIP: starting to hook up user-provided loaderEntryPoints

* chore: update lock file

* chore: update merged lockfile

* refactor: code cleanup and type docs

* pulling over the README template for first-party integrations

* moving metadata out to the loader

* updating the test for the refactored import

* revert: remove unrelated webapi formatting

* revert: remove unrelated change

* fixing up the existing sharp tests

* fix: vite plugin wasn't dynamically loading the image service properly

* refactor: minor API renaming, removing last hard-coded use of sharp loader

* don't manipulate src for hosted image services

* Adding support for automatically calculating dimensions by aspect ratio, if needed

* a few bug fixes + renaming the aspect ratio search param to "ar"

* Adding ETag support, removing need for loaders to parse file metadata

* using the battle tested `etag` package

* Adding support for dynamically calculating partial sizes

* refactor: moving to the packages/integrations dir, Astro Labs TBD later

* refactor: renaming parse/serialize functions

* Adding tests for SSG image optimizations

* refactor: clean up outdated names related to ImageProps

* nit: reusing cached SSG filename

* chore: update pnpm lock file

* handling file URLs when resolving local image imports

* updating image file resolution to use file URLs

* increasing test timeout for image build tests

* fixing eslint error in sharp test

* adding slash for windows compat in src URLs

* chore: update lockfile after merge

* Adding README content

* adding a readme call to action for configuration options

* review: A few of the quick updates from the PR review

* hack: adds a one-off check to allow query params for the _image route

* Adds support for src={import("...")}, and named component exports

* adding SSR tests

* nit: adding a bit more comments

* limiting the query params in SSG dev to the images integration
2022-07-01 15:47:48 +00:00
Fred K. Bot
0f73ece26b
[ci] release (#3783)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-07-01 03:09:17 +00:00
Tony Sullivan
976e1f175a
Adding an option to disable HTTP streaming (#3777)
* Adding a flag to disable HTTP streaming

* refactor: adding support for SSG builds

* handling string responses in the server runtime, adding tests

* removing streaming CLI flag

* removing import.meta.env.STREAMING

* include Content-Length header when streaming is disabled

* Verifying content-length header in dev

* fix: default streaming to enabled in the base App server

* TEMP: disabling the production test to investigate the test-adapter

* re-enabling the test with an adapter option to disable streaming for the test

* fix: use the existing TextEncoder to get the body's byte length

* moving config to build.streaming, ignoring it in `dev`

* fixing dev test to expect response streaming

* chore: add changsets

* removing the new config option all together 🎉

* remove temp debug log

* Updating astro changeset now that streaming isn't a config option
2022-07-01 02:29:59 +00:00
Fred K. Bot
d07ad8a782
[ci] release (#3774)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-30 11:39:44 -07:00
Nate Moore
032ad1c047
MDX support (#3706)
* feat: first pass at MDX support

* fix: move built-in JSX renderer to come first

* chore: remove jsx example

* chore: update lockfile

* chore: cleanup example

* fix: missing deps

* refactor: move component render logic to `renderPage`

* chore: update HMR script

* chore: update MDX example

* refactor: prefer unshit

* refactor: remove TODO comment

* fix: remove duplicate identifier

* refactor: cleanup mdx entrypoint

* fix: better html handling

* fix: add tsconfig to mdx package

* chore: update lockfile

* fix: do not sort plugins unless mdx is enabled

* chore: update compiler

* fix(hmr): maybe render head for non-Astro pages

* fix: set initial pageExtensions

* refactor: cleanup addPageExtension

* refactor: remove addPageExtensions from types

* refactor: expose HookParameters type

* fix: only default to astro for MDX

* test: pick up jsx support in test fixtures

* refactor: simplify mdx entrypoint

* test: add basic MDX tests

* test(e2e): add mdx + framework tests

* chore: update lockfile

* test(e2e): fix preact mdx e2e test

* fix(mdx): disable .md support

* test(e2e): fix vue-component test missing mdx

* test(e2e): fix solid component needing import

* fix: allow `client:only="solid"` as an alias to `solid-js`

* chore: move to with-mdx example

* chore: update MDX readme

* chore: update example readme

* chore: bump astro version

* chore: update lockfile

* Update mod.d.ts

* feat: support `export const components` in MDX pages

* chore: update mdx example

* fix: update jsx-runtime with better slot support

* refactor: remove object style support

* chore: cleanup package exports

* chore: add todo comment

* refactor: improve isPage function, move to utils

* refactor: dry up manual HMR updates

* chore: add dev tests for MDX

* chore: prefer set to array

* chore: add changesets

* fix(hmr): flip public/private route

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-30 13:09:09 -05:00
Fred K. Bot
d137169b7b
[ci] update lockfile (#3771)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-30 11:22:18 -05:00
Fred K. Bot
8cbe92b74b
[ci] release (#3772)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-30 08:08:09 -05:00
Fred K. Bot
38f2fd7723
[ci] release (#3759)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-29 17:11:48 -05:00
Fred K. Schott
4bc6c7ceaa
manual lockfile update (#3751)
* lockfile update

* update lockfile gen script

* Update index.ts
2022-06-29 14:54:40 -07:00
Chris Swithinbank
e3fdc9b403
Add preact/compat support to @astrojs/preact (#3712)
* Add preact/compat renderer (likely broken)

Based on the current Preact renderer and the old preact/compat implementation: f892aeb52f/packages/renderers/renderer-preact/compat/index.js

* Make sure name is consistent

* Switch to single integration with compat option

* fix: add module-resolver to alias react => preact/compat

* fix: preact/compat mode

* chore: remove client-compat entrypoint

* chore: add e2e test for preact/compat

* Try to fix frozen lock file error

* Add changeset

* Update README to new structure & document `compat`

* Fix changeset wording

* Fix README typo

* Tweak wording

Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>

Co-authored-by: Nate Moore <nate@astro.build>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Kevin Zuniga Cuellar <46791833+kevinzunigacuellar@users.noreply.github.com>
2022-06-29 17:42:47 +02:00
Fred K. Bot
a59a27eb0c
[ci] release (#3733)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-28 15:11:59 +00:00
Fred K. Bot
768c8ed21d
[ci] update lockfile (#3740)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
2022-06-28 08:33:13 -05:00
Tony Sullivan
79fe09fa30
Adds a prefetch integration for near-instant page navigations (#3725)
* Adds a basic @astrojs/prefetch integration

* adding tests for custom selectors

* missed in last commit

* Adding a few docs, removing the option for `selectors` to be an element array

* adding an option for the concurrency limit

* fixing test for updated integration options

* Update packages/labs/prefetch/src/client.ts

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>

* nit: removing the NodeJS.Timer type to allow typescript to infer the return

* updating docs for default selector with ~=

* Skip prefetching on 2G connections, or when data saver is enabled

* refactor: moving to packages/integrations, Astro Labs TBD down the road

* README typo fix

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-27 18:26:21 +00:00
Fred K. Schott
9d78162fd9
Prettier update with caching speedup (#3710)
* update lockfile on fresh install

* update prettier
2022-06-27 11:24:22 -07:00
github-actions[bot]
0ae1365533
[ci] release (#3726)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-27 10:40:35 -04:00
Fred K. Schott
c3d41d1f60
update lockfile on fresh install (#3709) 2022-06-25 10:24:59 -07:00
github-actions[bot]
701a3bd698
[ci] release (#3707)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-24 17:02:11 -04:00
Matthew Phillips
b5e3403fa1
Simplified Response#text() implementation (#3705)
* Simplified Response#text() implementation

* Adds a changeset

* Fix tsignore
2022-06-24 16:58:14 -04:00
Matthew Phillips
b11e3b38eb
Ensure import.meta.env.SSR is true in SSR mode (#3702)
* Ensure import.meta.env.SSR is true in SSR mode

* Define in the env plugin instead
2022-06-24 16:14:00 -04:00
Nate Moore
908c2638cb
Add *private* built-in JSX renderer (#3697)
* feat: add private `addPageExtensions` hook

* feat: experimental JSX support

* chore: remove experimental.jsx option from config

* chore: remove automatic astro JSX runtime detection

* fix: throw warning when client:* directive is used but no client entrypoint is found

* feat: add slot support to renderer

* chore: remove client entrypoint from jsx renderer

* test: add barebones JSX test

* test: add frameworks-in-jsx test

* feat: improve error message when no matching import is found

* feat: support slots

* fix: do not strip `astro-slot` when using JSX renderer

* fix: handle null values in isVNode

* fix: do not transform slots for elements

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-24 15:11:17 -05:00
github-actions[bot]
67b5aa4ca4
[ci] release (#3701)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-24 16:05:02 -04:00
Matthew Phillips
47c81effa6
Make Astro.redirect use a 302 status code (#3700)
* Make Astro.redirect use a 302 status code

* Adds a changeset

* Add a package.json
2022-06-24 15:55:06 -04:00
Matthew Phillips
3daaf510ea
Streaming (#3696)
* Start of streaming

* New lockfile

* Base should be Uint8Arrays

* Remove the ability to throw from a component

* Add a warning when returning a Response from a non-page component

* Adds a changeset
2022-06-24 15:35:21 -04:00
github-actions[bot]
6a6047483b
[ci] release (#3692)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-24 12:55:36 -05:00
Matthew Phillips
fa7ed3f3a9
Remove post-rendering head injection (#3679)
* Remove post-rendering head injection

* Adds a changeset

* Use a layout component for vue
2022-06-23 15:37:55 -04:00
d-suke
446f8c4f13
Added test for dir parameter in astro:build:done. (#3649)
* Added test for dir in astro:build:done

* Added changeset

* Change pathname for Windows

* Change changeset generated file summary

* Eliminate testing of branches by os

* Eliminate OS dependence

* Change changeset generated file summary

* Using fileURLToPath

* Cross-platform fixes.

* Use posix for everything.

* Pass an empty string for relative from

* Use path.join for the correct value

* Update packages/astro/test/static-build-dir.test.js

* Update packages/astro/test/static-build-dir.test.js

* Update packages/astro/test/static-build-dir.test.js

* Remove trailing slash

* add toString

* fix syntax error

Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
2022-06-23 14:04:10 -05:00
Nate Moore
7373d61cdc
Enable named slots in renderers (#3652)
* feat: pass all slots to renderers

* refactor: pass `slots` as top-level props

* test: add named slot test for frameworks

* fix: nested hydration, slots that are not initially rendered

* test: add nested-recursive e2e test

* fix: render unmatched custom element children

* chore: update lockfile

* fix: unrendered slots for client:only

* fix(lit): ensure lit integration uses new slots API

* chore: add changeset

* chore: add changesets

* fix: lit slots

* feat: convert dash-case or snake_case slots to camelCase for JSX

* feat: remove tmpl special logic

* test: add slot components-in-markdown test

* refactor: prefer Object.entries.map() to for/of loop

Co-authored-by: Nate Moore <nate@astro.build>
2022-06-23 10:10:54 -05:00
github-actions[bot]
19cd962d0b
[ci] release (#3684)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-23 09:14:17 -04:00
Matthew Phillips
b36ecb717e
Include partytown scripts in SSR manifest (#3686)
* Include partytown scripts in SSR manifst

* Adds a changeset
2022-06-23 09:03:43 -04:00
Ben Holmes
3d554fdbfb
Fix: pass Astro config postcss to Svelte preprocess (#3685)
* fix: pass Astro config postcss to Svelte preprocess

* test: preset env for nested styles

* chore: changeset
2022-06-22 19:52:32 -04:00
Matthew Phillips
9a813268db
Allow TypeScript in hoisted scripts (#3665)
* Allow TypeScript in hoisted scripts

* Pass skipSelf

* Fix linting
2022-06-22 12:47:52 -04:00
Matthew Phillips
85c33751c2
Allow specifying entryFileNames for client JS (#3676)
* Allow specifying entryFileNames for client JS

* Adds a changeset
2022-06-22 12:32:17 -04:00
github-actions[bot]
8ad146a5d7
[ci] release (#3683)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-22 12:19:43 -04:00
Tony Sullivan
b8c6dabfb7
Enables eslint on the full repo and adds a rule for no only() tests (#3659)
* enabling eslint on the all packages and tests

* enabling for all packages

* TEMP: adding an only() test to verify it fails CI

* using our eslint config and ignore in CI

* removing the temporary .only() test

* update lock file

* lint: fixing new test with a no-shadow warning

* chore: update lock file
2022-06-22 15:59:49 +00:00
Matthew Phillips
898845402c
Include all client build artifacts in SSRManifest (#3678)
* Include all client build artifacts in SSRManifest

* Adds a changeset
2022-06-22 11:35:54 -04:00
github-actions[bot]
119283775a
[ci] release (#3666)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-22 10:05:21 -04:00
hippotastic
ba5ad7855c
Fix react dependencies to improve test reliability (#3673)
* Fix local react tests by unifying versions

* Add missing dependencies to react tests

* Add changeset

* Fix lockfile

Co-authored-by: Matthew Phillips <matthew@skypack.dev>
2022-06-22 09:11:48 -04:00
Matthew Phillips
46d1ea941b
Revert "add Astro Deno Example (#3645)" (#3674)
This reverts commit e88b23ea52.
2022-06-22 08:30:22 -04:00
Elian ☕️
e88b23ea52
add Astro Deno Example (#3645)
* add Astro Deno Example

* add changeset

* update pnpm lock

Co-authored-by: Dan Jutan <danjutan@gmail.com>
2022-06-21 13:07:07 -04:00
github-actions[bot]
b4db008e53
[ci] release (#3664)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-21 12:47:04 -04:00
Matthew Phillips
c20b93c484
Resolve .jsx -> .tsx in hydrated components (#3663) 2022-06-21 12:35:11 -04:00
github-actions[bot]
e13ce4d751
[ci] release (#3662)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2022-06-21 11:50:06 -04:00