* updating the default listed in config jsdocs
* chore: adding changeset
* outDir had the wrong default listed as well
* chore: updating changeset description
* Replaced `--experimental-ssr` with `isBuildingToSSR`
* changest
* Improved `isBuildingToSSR` a bit
* Added `isBuildingToSSR` to more places!!1!
* Added `@deprecated` tag
* Replaced missing experimentalSsr
* Added failing test
* Removed test
* Re-added experimental ssr flag
* Fixed typo
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
* Fixed deno tests
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
* First pass at supporting React 18 in @astrojs/react
* Try marking React 18’s `react-dom/client` as external
* Try a different approach to importing different React versions
* Allow resolving JSON modules
* Revert "Allow resolving JSON modules"
This reverts commit 5279b7249c.
* Try the separate client entrypoint approach from #2946
* Clean up diff
* Trying to see something
* Just keep swimming… 🐠
* update to support react 18
* add changeset
* add docs
Co-authored-by: delucis <swithinbank@gmail.com>
* Bundle everything, commit 1
* Get everything working
* Remove dependency on readable-stream
* Adds a changeset
* Fix ts errors
* Use the node logger in tests
* Callback the logger when done writing
* Fix test helper to await the callback
* Use serialize-javascript again
* Remove dead code
* Rename hook
* Oops
* Implement the Astro.request RFC
* Disable console warnings eslint
* Use our logger
* Adds a changeset
* Fix tests that depend on params, canonicalURL, URL
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
* clean up error logging in astro
* update from ben feedback
* Update packages/astro/src/core/build/generate.ts
Co-authored-by: Ben Holmes <hey@bholmes.dev>
Co-authored-by: Ben Holmes <hey@bholmes.dev>
* Fix type of `integrations` in config
As per [docs](https://docs.astro.build/en/reference/integrations-reference/#combining-plugins), an integration can return an array of `AstroIntegration` objects to support bundling a collection of integrations as a preset. This change reflects that usages in the typing for the user config object.
* Add changeset
* Prevent CSS from being added to pages not using it
* Adds a changeset
* Add clarification when the CSS is appended to the pageData
* Move addStyles up a level
* Netlify adapter
* Remove package.json export that doesnt exist
* Fix out path
* Make netlifyFunctions the default
* Make the dist configurable
* Add an export for the functions
* Append of the file exists
* Build to a single file
* Updates based on initial code review
* Adds a changeset
* Use the default export for cjs module
* Await generatePages
* Prevent timing from causing module to not import
* Fix shared CSS
* Properly handle windows ids
* Dont shadow
* Fix ts errors
* Remove console.log
* feat: log setup, vite, and route gen steps
* refactor: add back "build" + timestamp for consistency
* feat: improve ms increase logs to match old debug output
* feat: add log for server assets
* chore: remove redundant debug logs
* feat: add logs for ssr steps
* fix: hide per-page log for ssr builds
* fix: hide "index.html" from debug log in SSR
* feat: add log for "collecting page data" step
* feat: add timeout logs for longer data imports
* chore: add changeset
* remove (includes setup + teardown)
* refactor: add newline to separate ssr from client build
* fix: move "gen static routes" heading to pages
* fix: only show client build ms when triggered
* fix: remove dup render loop
* chore: remove unused static-build imports
* Adapter v0
* Finalizing adapters
* Update the lockfile
* Add the default adapter after config setup is called
* Create the default adapter in config:done
* Fix lint error
* Remove unused callConfigSetup
* remove unused export
* Use a test adapter to test SSR
* Adds a changeset
* Updated based on feedback
* Updated the lockfile
* Only throw if set to a different adapter
* Clean up outdated comments
* Move the adapter to an config option
* Make adapter optional
* Update the docs/changeset to reflect config API change
* Clarify regular Node usage
* Fix island deduplication ignoring props.
Re-resolves an issue initially patched in https://github.com/withastro/astro/pull/846 but seemingly lost in the 0.21.0 mega-merge (d84bfe719a).
This change makes the component render step account for all props, even if they don't affect the generated HTML, when deduplicating island mount.
* Fix React component test using different rendered props to test deduplication.
* fix: improve serialization support for non-JSON objects
Co-authored-by: Nate Moore <nate@skypack.dev>
* Implements redirects, headers for SSR
* Move away from an explicit Request
* Properly handle endpoint routes in the build
* chore(lint): ESLint fix
* Update based on review comments
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* fix: missing style imports on initial load
* chore: changeset
* fix: update comment on using URL map
* fix: use getModulesByFile to match on ID properly
* refactor: use imperative loop for performance
* fix: update scan from each matching mod
* fix: update scan from importedMod loop
* fix: avoid scanning all related mods
* feat: update config to support bool --hostname
* fix: show localhost for --hostname=true
* feat: address logging feature parity w/ Vite
* chore: update type docs
* refactor: extract local, network prefs to variable
* feat: add --host to --help output
* feat: deprecate --hostname, add --host
* feat: add --host tests
* feat: update preview to support new flags
* fix: show --host in dev server log
* feat: update config tests for --host flag
* chore: test lint
* chore: update lock with new fixture
* chore: add changeset
* refactor: add more details to JSdocs
* fix: update path tests
* feat: only expose when --host is not local
* fix: make flag --help less verbose
* fix: address @types comments
* fix: lint
* chore: remove unused import
* fix: use host flag for config test
* fix: ensure local logs come before network
* refactor: switch up that network logging one last time!
* feat: update unit tests
* chore: remove debugging block
* fix: only parse network logs if network is present
* Unflag the static build (#2652)
* Unflag the static build
* Only set legacyBuild to false if experimentalSSR is true
* Use legacy build when we have to
* Put a few more tests into legacy mode
* Last two
* Make astro-basic use the legacy build
* Adds a changeset
* Mark the lit test as legacy
* Update yarn lock
* Update based on feedback
* Add --legacy-build flag
* Move astro-basic test to use static build (#2682)
* Move some tests over to the static build (#2677)
* Move some tests over to the static build
* Fix assets tests
* Fix the assets tests
* Fix for the client:only components
* Moves asset tests to the static build
* Move postcss test over to static build
* Bring back legacy build for astro-basic test
* Move astro-basic test to use static build
* Migrate more tests to the static build (#2693)
* fix: disable HMR during build (#2684)
* Migrate more tests to the static build
* Only prepend links in non-legacy mode
* Add the 0-css tests
* Convert all CSS tests to the static build
* Migrate Astro global tests
* Remove .only
* Fix static build tests
* Migrate a few more
* More tests
* Move the lit test back to legacy
* Increase the test timeout
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* Improve `head` injection behavior (#2436)
* feat: add renderHead util to server
* feat: remove `layouts` from config, Vite plugin
* fix: improve head injection during rendering
* chore: update compiler
* fix: do not escape links
* chore: enter `pre` mode
* Replace `send` with `sirv` (#2713)
* remove send
* Create thick-ravens-chew.md
* I feel like I'm going to screw something up
* working finally!
* rewrite req.url
* Add tiny bit of doc
* Update .gitignore
Co-authored-by: Evan Boehs <evan@boehs.org>
* Move remaining tests to the static build (#2712)
* Move lit test to the static build
* Migrate astro-env plugin to work in the static build
* Do not remove vite:define
* Adds a changeset
* Add a warning when passing the --experimental-static-build flag (#2718)
* Add a warning when passing the --experimental-static-build flag
* Disable the lint warning
* [ci] release (next) (#2721)
* [ci] release (next)
* chore: update changeset
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Nate Moore <nate@skypack.dev>
* 404 page (#2719)
* Fix: build to 404.html in the static build
* Adds a changeset
* fix pnpm install missing peer deps
* fix svelte version in workspace
* fix lockfile
* fix(webapi): add dev script
* improve preview reliability (#2739)
* improve preview reliability - fix broken tests
* shamefully hoist to unblock
* remove lit from test running
* chore: update lockfile
Co-authored-by: Matthew Phillips <matthew@skypack.dev>
Co-authored-by: Evan Boehs <evan@boehs.org>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
* feat: show "localhost" for local network IPs
* refactor: remove timestamps from addr logs
* fix: hide timestamp on null types
* feat: add emoji OS helper
* feat: make logs 100% nicer
* refactor: extract isLocalHost to util
* feat: update preview logs to match
* chore: add changeset
* fix: pull pkg version from package.json
* refactor: remove 👉 guys
* fix: devStart return type
* feat: inject process.env.PACKAGE_VERSION at build time
* feat: update unit test for hostname checks
Co-authored-by: Nate Moore <nate@skypack.dev>
* Pass children to client components even if they do not render them
* Handle when no children are provided
* Adds a changeset
* Use roots directly i guess
* Use an attribute to signal that the template is needed
* Resolve relative imports from hoisted scripts
* Adds a changeset
* Windows fix
* Set a longer timeout for the Lit test
* blah
* Handle windows properly
* Only if the from is astro
* Windows debugging
* This might fix it
* another try
* use only
* More debugging
* Does this work
* Final cleanup
* Update the lockfile
* adds support for build non-html pages
* add non-html pages to the static build test suite
* adds getStaticPaths() test for non-html pages
* adds dev server tests for non-html pages
* ading a changeset
* updating changeset description
* testing for building non-html files with async data
* fixing typo in changeset docs
* Checkpoint, basics are working
* Add the `--experimental-ssr` flag
* Adds the changeset
* Fixes population of getStaticPaths results
* Pass through the imported module
* Route manifest test
* Fix remaining tests
* Fix remaining tests
* Copy server assets over
* Fix types
* Allowing passing in the request to the Node version of App
* Improve the example app
* Gets CI to pass
* Replaced `shikiTheme` with `shikiConfig`
* Code.astro now accepts custom themes/langs
* Updated docs
* Updated tests
* Fixed language loading
* Added customization examples
* Updated documentation
* Added more tests
* Changelogs
* Changed some spaces to tabs
* Fixed typo in changesets
* Moved tests fixtures
* Rolled back changes to with-markdown-shiki
* Removed lang example in docs
* Optimized Code component
* Try to fix windows errors
* Try to see if this new tests work
* [ci] yarn format
* Added shiki to markdown-remark
* Upgraded astro shiki
* Added minimal example
* Changed defaults to match <Code />
* Replace `shiki` with `astro` classes
* Added documentation
* Updated Astro code to use new `codeToHtml`
* Added changesets
* Added basic test
* Updated tests a bit
Co-authored-by: JuanM04 <JuanM04@users.noreply.github.com>
* standardize trailing subpath, and fix fetchcontent issue
* debug windows ci
* improve ci test
* fix windows test issue?
* fix only usage
* end debugging
* Handle project folders containing a space
* Adds a changeset
* Bump the test package version
* Use server relative paths as entries
* Fix windows
* A hoisted fix
* Correctly handle facadeIds on windows
* Fix HMR in static build + @import HMR
* Changeset
* Add a comment on what cleanUrl is doing
* Running prettier
* Improve comments on how the static build compilation
works differently.
* Allow pre-generated urls to be passed in rss feeds
* Fix variable name
* Add isValidURL helper function
* Remove scary RegEx and tidy up code
* add test for using pregenerated urls
* fix: allow rss to be called multiple times
* test: normalize rss feed in test
* chore: add changeset
Co-authored-by: Zade Viggers <74938858+zadeviggers@users.noreply.github.com>
Co-authored-by: zadeviggers <zade.viggers@gmail.com>
* Resolve sitemap URLs in relation to full site path
Fixes#2422
* Test generated sitemap contains base directory in URLs
* Add changeset
* test: Add `clean` helper to loaded fixture API
Adds a method that when called will remove the loaded fixture’s dist directory using `rimraf`.
* test: Clean up between sitemap/RSS tests
* See if letting rimraf retry more helps…
* Add logging to double check nothing’s running in parallel
* Remove logging & double check clean up actually succeeds
* Try using basic Node.js to clean up dist
* Remove logging/checks
* Remove stray unnecessary `async` keyword
* Supports hoisted scripts in the static build
* Adds a changeset
* Update packages/astro/src/core/build/internal.ts
Co-authored-by: Evan Boehs <evan@boehs.org>
* Update based on feedback
* Fix lint
* Fix getting hoist script for Windows
* Try with the pre compiler
* use compiler 0.8.2
* update compiler version
* update yarn.lock
Co-authored-by: Evan Boehs <evan@boehs.org>
* Add verbose logging to create-astro
* Tell user to use the verbose flag when encountering the MISSING_REF error
* Create changeset
* Add information in README
* Format
* Use switch statement instead of if and if else blocks
* Update packages/create-astro/src/logger.ts
Make if statement easier to read
Co-authored-by: Evan Boehs <evan@boehs.org>
Co-authored-by: Evan Boehs <evan@boehs.org>
* [ci] collect stats
* [ci] update lockfile (#2388)
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
* Fixes for blog and docs examples (#2373)
* Fixes for blog and docs examples
* Adds a changeset
* Upgrade the compiler version
* Use a global style tag
* Skip on windows temporarily
* [ci] yarn format
* Fixes Lit support in the static build
* Adds a changeset
* test
* Upgrade lit-labs/ssr
* Conditional
* Testing again
* remove debugging code
* changeset
Co-authored-by: FredKSchott <FredKSchott@users.noreply.github.com>
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
* Fix use of frameworks in the static build
* Adding a changeset
* fix typescript
* Empty out the directory before running the builds
* Use a util to empty the directory
* Only empty the outdir if needed
* Move prepareOutDir to its own module
* Prepare outDir is actually sync
* Fix: static-build with .md pages
This fixes the `--experimental-static-build` flag to work with markdown
pages.
* Adds a changeset
* Account for difference in specifier on windows
* Fix issue with plugins running twice in dev and build
* nit: only patch plugins
* nit: only patch plugins
* nit: only solve for create-vite
* nit: only solve for create-vite
* Create seven-mice-do.md
Co-authored-by: Fred K. Schott <fkschott@gmail.com>
* Handle loading the Code package
Fixes#2329
* Use Code the normal way
* Adds a changeset
* Only resolve browser path if there is no common ancestor
* Update examples/fast-build/src/pages/index.astro
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
* Fix subpath support regressions
* Adds a changeset
* Update tests to reflect relative URL change
* Pick a different port and hopefully windows works
* Remove bad lint warning
* Better handling of relative paths
* or
* Fixes use with pageUrlFormat
* Update the pageDirectoryUrl test
* Update svelte version in renderer-svelte
I am having funny console logs saying that my svelte component `received an unexpected slot "default".`. This issue is described here: https://github.com/sveltejs/kit/issues/981
Supposedly, updating svelte to version 3.44.3 solves this issue. I couldn't test it, though.
* Update Svelte to 3.44.3 to get rid of console warning that component receives an unexpected slot "default".
* Revert "Revert "Implement hydrated components in the static build (#2260)""
This reverts commit 17ac18e88c.
* Only resolve specifiers in the static build
* Adding a changeset
* Fix the client-only test
* Don't overwrite the stack when using verbose logging
This makes it so that if the compiler panics and `--verbose` logging is
on (debug level), we don't replace the stack trace.
* Adds a changeset