diff options
Diffstat (limited to 'packages/integrations/turbolinks')
-rw-r--r-- | packages/integrations/turbolinks/CHANGELOG.md | 69 | ||||
-rw-r--r-- | packages/integrations/turbolinks/README.md | 78 | ||||
-rw-r--r-- | packages/integrations/turbolinks/client.js | 18 | ||||
-rw-r--r-- | packages/integrations/turbolinks/package.json | 42 | ||||
-rw-r--r-- | packages/integrations/turbolinks/src/index.ts | 18 | ||||
-rw-r--r-- | packages/integrations/turbolinks/tsconfig.json | 10 |
6 files changed, 0 insertions, 235 deletions
diff --git a/packages/integrations/turbolinks/CHANGELOG.md b/packages/integrations/turbolinks/CHANGELOG.md deleted file mode 100644 index e9bd6a75a..000000000 --- a/packages/integrations/turbolinks/CHANGELOG.md +++ /dev/null @@ -1,69 +0,0 @@ -# @astrojs/turbolinks - -## 0.2.2 - -### Patch Changes - -- [#7104](https://github.com/withastro/astro/pull/7104) [`826e02890`](https://github.com/withastro/astro/commit/826e0289005f645b902375b98d5549c6a95ccafa) Thanks [@bluwy](https://github.com/bluwy)! - Specify `"files"` field to only publish necessary files - -## 0.2.1 - -### Patch Changes - -- [#6419](https://github.com/withastro/astro/pull/6419) [`0de08773f`](https://github.com/withastro/astro/commit/0de08773f30cef0e131e42f2068ff56f826b41c0) Thanks [@Yan-Thomas](https://github.com/Yan-Thomas)! - Make Tailwind & Turbolinks integration descriptions more consistent - -## 0.2.0 - -### Minor Changes - -- [#6213](https://github.com/withastro/astro/pull/6213) [`afbbc4d5b`](https://github.com/withastro/astro/commit/afbbc4d5bfafc1779bac00b41c2a1cb1c90f2808) Thanks [@Princesseuh](https://github.com/Princesseuh)! - Updated compilation settings to disable downlevelling for Node 14 - -## 0.1.5 - -### Patch Changes - -- [#5478](https://github.com/withastro/astro/pull/5478) [`1c7eef308`](https://github.com/withastro/astro/commit/1c7eef308e808aa5ed4662b53e67ec8d1b814d1f) Thanks [@nemo0](https://github.com/nemo0)! - Update READMEs for consistency - -## 0.1.4 - -### Patch Changes - -- [#3854](https://github.com/withastro/astro/pull/3854) [`b012ee55`](https://github.com/withastro/astro/commit/b012ee55b107dea0730286263b27d83e530fad5d) Thanks [@bholmesdev](https://github.com/bholmesdev)! - [astro add] Support adapters and third party packages - -## 0.1.3 - -### Patch Changes - -- [#3383](https://github.com/withastro/astro/pull/3383) [`387ed0cf`](https://github.com/withastro/astro/commit/387ed0cfa1ed73e0025dd81f221ea7c95d724a59) Thanks [@tony-sull](https://github.com/tony-sull)! - The @astrojs/turbolinks integration has been deprecated - -## 0.1.2 - -### Patch Changes - -- [#3283](https://github.com/withastro/astro/pull/3283) [`9ad8aefd`](https://github.com/withastro/astro/commit/9ad8aefdd79a039062f5a0510fabb2b5e535603f) Thanks [@tony-sull](https://github.com/tony-sull)! - Fixes an issue that prevented client components from rehydrating when navigating back to a page - -## 0.1.1 - -### Patch Changes - -- [`815d62f1`](https://github.com/withastro/astro/commit/815d62f151a36fef7d09590d4962ca71bda61b32) Thanks [@FredKSchott](https://github.com/FredKSchott)! - no changes. - -## 0.1.0 - -### Minor Changes - -- [#2979](https://github.com/withastro/astro/pull/2979) [`9d7a4b59`](https://github.com/withastro/astro/commit/9d7a4b59b53f8cb274266f5036d1cef841750252) Thanks [@FredKSchott](https://github.com/FredKSchott)! - Welcome to the Astro v1.0.0 Beta! Read the [official announcement](https://astro.build/blog/astro-1-beta-release/) for more details. - -## 0.0.2 - -### Patch Changes - -- [#2885](https://github.com/withastro/astro/pull/2885) [`6b004363`](https://github.com/withastro/astro/commit/6b004363f99f27e581d1e2d53a2ebff39d7afb8a) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Add README across Astro built-in integrations - -* [#2847](https://github.com/withastro/astro/pull/2847) [`3b621f7a`](https://github.com/withastro/astro/commit/3b621f7a613b45983b090794fa7c015f23ed6140) Thanks [@tony-sull](https://github.com/tony-sull)! - Adds keywords to the official integrations to support discoverability on Astro's Integrations site - -## 0.0.2-next.0 - -### Patch Changes - -- [#2847](https://github.com/withastro/astro/pull/2847) [`3b621f7a`](https://github.com/withastro/astro/commit/3b621f7a613b45983b090794fa7c015f23ed6140) Thanks [@tony-sull](https://github.com/tony-sull)! - Adds keywords to the official integrations to support discoverability on Astro's Integrations site diff --git a/packages/integrations/turbolinks/README.md b/packages/integrations/turbolinks/README.md deleted file mode 100644 index bd9b1c695..000000000 --- a/packages/integrations/turbolinks/README.md +++ /dev/null @@ -1,78 +0,0 @@ -# This integration is no longer actively supported - -[Turbolinks](https://github.com/turbolinks/turbolinks) is no longer under active development. The `@astrojs/turbolinks` integration has been deprecated. - -## Looking for an alternative? - -Check out [swup](https://swup.js.org/)! If you are using any `client:*` script for partial hydration, make sure to install the `@swup/scripts-plugin` to ensure components are rehydrated after a page navigation. - -# @astrojs/turbolinks ⚡️ - -This **[Astro integration][astro-integration]** brings [Turbo](https://github.com/hotwired/turbo) to your Astro project. - -Turbolinks is a plug-and-play solution to bring single page app (SPA) routing to your site. This brings performant navigation without the added complexity of a client-side JavaScript framework. - -## Installation - -There are two ways to add integrations to your project. Let's try the most convenient option first! - -### (experimental) `astro add` command - -Astro includes a CLI tool for adding first party integrations: `astro add`. This command will: - -1. (Optionally) Install all necessary dependencies and peer dependencies -2. (Also optionally) Update your `astro.config.*` file to apply this integration - -To install `@astrojs/turbolinks`, run the following from your project directory and follow the prompts: - -```sh -# Using NPM -npx astro add turbolinks -# Using Yarn -yarn astro add turbolinks -# Using PNPM -pnpm astro add turbolinks -``` - -If you run into any issues, [feel free to report them to us on GitHub](https://github.com/withastro/astro/issues) and try the manual installation steps below. - -### Install dependencies manually - -First, install the `@astrojs/turbolinks` integration like so: - -```sh -npm install @astrojs/turbolinks -``` - -Then, apply this integration to your `astro.config.*` file using the `integrations` property: - -**`astro.config.mjs`** - -```js -import { defineConfig } from 'astro/config'; -import turbolinks from '@astrojs/turbolinks'; - -export default defineConfig({ - // ... - integrations: [turbolinks()], -}); -``` - -## Getting started - -Turbo links, frames, and more should be ready-to-use with zero config. For instance, try navigating between different pages via links. You should no longer see browser refreshes! You will also find each page request passing through `turbolinks` under the "Network" tab in [your browser's dev tools](https://developer.chrome.com/docs/devtools/). - -Head to [the Turbo handbook](https://turbo.hotwired.dev/handbook/introduction) for all options and features available. You can also check our [Astro Integration Documentation][astro-integration] for more on integrations. - -## Troubleshooting - -For help, check out the `#support` channel on [Discord](https://astro.build/chat). Our friendly Support Squad members are here to help! - -You can also check our [Astro Integration Documentation][astro-integration] for more on integrations. - -## Contributing - -This package is maintained by Astro's Core team. You're welcome to submit an issue or PR! - -[astro-integration]: https://docs.astro.build/en/guides/integrations-guide/ -[astro-ui-frameworks]: https://docs.astro.build/en/core-concepts/framework-components/#using-framework-components diff --git a/packages/integrations/turbolinks/client.js b/packages/integrations/turbolinks/client.js deleted file mode 100644 index 2305f3cf4..000000000 --- a/packages/integrations/turbolinks/client.js +++ /dev/null @@ -1,18 +0,0 @@ -import Turbolinks from 'turbolinks'; -export { Turbolinks }; - -// Before every page navigation, remove any previously added component hydration scripts -document.addEventListener('turbolinks:before-render', function () { - const scripts = document.querySelectorAll('script[data-astro-component-hydration]'); - for (const script of scripts) { - script.remove(); - } -}); - -// After every page navigation, move the bundled styles into the body -document.addEventListener('turbolinks:render', function () { - const styles = document.querySelectorAll('link[href^="/assets/asset"][href$=".css"]'); - for (const style of styles) { - document.body.append(style); - } -}); diff --git a/packages/integrations/turbolinks/package.json b/packages/integrations/turbolinks/package.json deleted file mode 100644 index 067b8de28..000000000 --- a/packages/integrations/turbolinks/package.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "name": "@astrojs/turbolinks", - "description": "Deprecated — Use Turbolinks to speed up page navigation in your Astro site", - "version": "0.2.2", - "type": "module", - "types": "./dist/index.d.ts", - "author": "withastro", - "license": "MIT", - "repository": { - "type": "git", - "url": "https://github.com/withastro/astro.git", - "directory": "packages/integrations/turbolinks" - }, - "keywords": [ - "astro-integration", - "astro-component", - "performance" - ], - "bugs": "https://github.com/withastro/astro/issues", - "homepage": "https://astro.build", - "exports": { - ".": "./dist/index.js", - "./client.js": "./client.js", - "./package.json": "./package.json" - }, - "files": [ - "dist", - "client.js" - ], - "scripts": { - "build": "astro-scripts build \"src/**/*.ts\" && tsc", - "build:ci": "astro-scripts build \"src/**/*.ts\"", - "dev": "astro-scripts dev \"src/**/*.ts\"" - }, - "dependencies": { - "turbolinks": "^5.2.0" - }, - "devDependencies": { - "astro": "workspace:*", - "astro-scripts": "workspace:*" - } -} diff --git a/packages/integrations/turbolinks/src/index.ts b/packages/integrations/turbolinks/src/index.ts deleted file mode 100644 index fbf893f68..000000000 --- a/packages/integrations/turbolinks/src/index.ts +++ /dev/null @@ -1,18 +0,0 @@ -import type { AstroIntegration } from 'astro'; - -export default function createPlugin(): AstroIntegration { - return { - name: '@astrojs/turbolinks', - hooks: { - 'astro:config:setup': ({ injectScript }) => { - // This gets injected into the user's page, so we need to re-export Turbolinks - // from our own package so that package managers like pnpm don't get mad and - // can follow the import correctly. - injectScript( - 'page', - `import {Turbolinks} from "@astrojs/turbolinks/client.js"; Turbolinks.start();` - ); - }, - }, - }; -} diff --git a/packages/integrations/turbolinks/tsconfig.json b/packages/integrations/turbolinks/tsconfig.json deleted file mode 100644 index 64d4ef454..000000000 --- a/packages/integrations/turbolinks/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.base.json", - "include": ["src"], - "compilerOptions": { - "allowJs": true, - "module": "ES2022", - "outDir": "./dist", - "target": "ES2021" - } -} |