-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Vite plugins to their new home (#1935)
* Move Oxygen plugin to mini-oxygen package * Do not log favicon requests * Ignore .shopify directory from all examples * Move Hydrogen plugin to hydrogen package * Add coverage check * Pass plugin options using a public API * Get plugin options in CLI for checks * Flatten Oxygen plugin options * Type safety for plugin API * Simplify services in MiniOxygen * Improve critical CSS code and docs * Adapt subrequest profiler backend to Vite * Replace setupScripts with crossBoundarySetup in MiniOxygen Vite * Add Vite types to tsconfig.json * Create __H2O_LOG_EVENT directly in Vite * Update projects to new plugin paths * Fix HMR * Fix cross-package types * Minor fixes to build types * Fix virtual route test for classic compiler * Fix type * Add subrequest profiler logger globally in Node environments * Improve types and split logic of mini-oxygen handler * Replicate requestHook at the Vite Environment level * Fix re-using request body * Make the request hook be a POST request * Move source of truth for sub-request profiler types to Hydrogen package * Fix cross-package types * Start sending subrequest-profiler events from Hydrogen middleware instead of remix-oxygen * Support subrequest profiler in Node.js servers * Use Remix presets for virtual routes (#1940) * Use Remix presets for virtual routes * Pin oxygen-cli dependency to fix installation * Avoid adding virtual routes in build * Wrap virtual routes in virtual root * Omit user root when rendering virtual routes * Move buildDirectory to preset and use it in projects * Update tests * Use RemixConfig for appDir * Hide non actionable error about critical CSS in virtual routes * Improve types * Read remix config from Hydrogen plugin * Fix plugin types in vite.config.ts * Changesets * Remove unused internal feature * Remove @experimental comment * Dedup package-lock.json
- Loading branch information
Showing
79 changed files
with
1,863 additions
and
1,121 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
--- | ||
'skeleton': patch | ||
--- | ||
|
||
In Vite projects, the way that plugins are imported and the options passed to Remix have changed: | ||
|
||
```diff | ||
-import {hydrogen, oxygen} from '@shopify/cli-hydrogen/experimental-vite'; | ||
+import {hydrogen} from '@shopify/hydrogen/vite'; | ||
+import {oxygen} from '@shopify/mini-oxygen/vite'; | ||
import {vitePlugin as remix} from '@remix-run/dev'; | ||
|
||
export default defineConfig({ | ||
hydrogen(), | ||
oxygen(), | ||
remix({ | ||
- buildDirectory: 'dist', | ||
+ presets: [hydrogen.preset()], | ||
future: { | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/hydrogen': patch | ||
--- | ||
|
||
A new Vite plugin is exported from `@shopify/hydrogen/vite`. It provides DX improvements for Vite users, such as adding `/subrequest-profiler` and `/graphiql`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/remix-oxygen': patch | ||
--- | ||
|
||
Fix compatibility of `/subrequest-profiler` with Vite. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/cli-hydrogen': minor | ||
--- | ||
|
||
The `@shopify/cli-hydrogen/experimental-vite` import path has been removed. Instead, use `@shopify/hydrogen/vite` and `@shopify/mini-oxygen/vite` to import the Vite plugins. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@shopify/mini-oxygen': minor | ||
--- | ||
|
||
A new Vite plugin is exported from `@shopify/mini-oxygen/vite`. It integrates Vite with MiniOxygen by running the application code within a worker. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ node_modules | |
.vscode | ||
.turbo | ||
.cache | ||
.shopify | ||
/test-results/ | ||
/playwright-report/ | ||
/playwright/.cache/ | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.