Skip to content

Commit

Permalink
Merge branch 'release-next'
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Feb 21, 2024
2 parents 91af129 + ed69fc1 commit bc761d5
Show file tree
Hide file tree
Showing 38 changed files with 174 additions and 63 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,14 @@ Date: YYYY-MM-DD
-->

## 2.7.2

Date: 2024-02-21

### Patch Changes

- Vite: Fix error when building projects with `.css?url` imports ([#8829](https://github.com/remix-run/remix/pull/8829))

## 2.7.1

Date: 2024-02-20
Expand Down
2 changes: 1 addition & 1 deletion integration/helpers/vite-template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@types/react-dom": "^18.2.7",
"eslint": "^8.38.0",
"typescript": "^5.1.6",
"vite": "5.1.0",
"vite": "5.1.3",
"vite-tsconfig-paths": "^4.2.1"
},
"engines": {
Expand Down
13 changes: 11 additions & 2 deletions integration/helpers/vite.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,21 @@ export async function createProject(files: Record<string, string> = {}) {
return projectDir;
}

export const viteBuild = ({ cwd }: { cwd: string }) => {
export const viteBuild = ({
cwd,
env = {},
}: {
cwd: string;
env?: Record<string, string>;
}) => {
let nodeBin = process.argv[0];

return spawnSync(nodeBin, [remixBin, "vite:build"], {
cwd,
env: { ...process.env },
env: {
...process.env,
...env,
},
});
};

Expand Down
10 changes: 9 additions & 1 deletion integration/vite-css-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,15 @@ test.describe(() => {
contents.replace('"sideEffects": false', '"sideEffects": ["*.css.ts"]')
);

viteBuild({ cwd });
let { stderr, status } = viteBuild({
cwd,
env: {
// Vanilla Extract uses Vite's CJS build which emits a warning to stderr
VITE_CJS_IGNORE_WARNING: "true",
},
});
expect(stderr.toString()).toBeFalsy();
expect(status).toBe(0);
stop = await viteRemixServe({ cwd, port });
});
test.afterAll(() => stop());
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"unified": "^10.1.2",
"unist-util-remove": "^3.1.0",
"unist-util-visit": "^4.1.1",
"vite": "5.1.0",
"vite": "5.1.3",
"wait-on": "^7.0.1"
},
"engines": {
Expand Down
2 changes: 2 additions & 0 deletions packages/create-remix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `create-remix`

## 2.7.2

## 2.7.1

## 2.7.0
Expand Down
2 changes: 1 addition & 1 deletion packages/create-remix/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "create-remix",
"version": "2.7.1",
"version": "2.7.2",
"description": "Create a new Remix app",
"homepage": "https://remix.run",
"bugs": {
Expand Down
7 changes: 7 additions & 0 deletions packages/remix-architect/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@remix-run/architect`

## 2.7.2

### Patch Changes

- Updated dependencies:
- `@remix-run/[email protected]`

## 2.7.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/remix-architect/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/architect",
"version": "2.7.1",
"version": "2.7.2",
"description": "Architect server request handler for Remix",
"bugs": {
"url": "https://github.com/remix-run/remix/issues"
Expand All @@ -15,7 +15,7 @@
"typings": "dist/index.d.ts",
"dependencies": {
"@architect/functions": "^5.2.0",
"@remix-run/node": "2.7.1",
"@remix-run/node": "2.7.2",
"@types/aws-lambda": "^8.10.82"
},
"devDependencies": {
Expand Down
7 changes: 7 additions & 0 deletions packages/remix-cloudflare-pages/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@remix-run/cloudflare-pages`

## 2.7.2

### Patch Changes

- Updated dependencies:
- `@remix-run/[email protected]`

## 2.7.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/remix-cloudflare-pages/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/cloudflare-pages",
"version": "2.7.1",
"version": "2.7.2",
"description": "Cloudflare Pages request handler for Remix",
"bugs": {
"url": "https://github.com/remix-run/remix/issues"
Expand All @@ -15,7 +15,7 @@
"typings": "dist/index.d.ts",
"module": "dist/esm/index.js",
"dependencies": {
"@remix-run/cloudflare": "2.7.1"
"@remix-run/cloudflare": "2.7.2"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20230518.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/remix-cloudflare-workers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@remix-run/cloudflare-workers`

## 2.7.2

### Patch Changes

- Updated dependencies:
- `@remix-run/[email protected]`

## 2.7.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/remix-cloudflare-workers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/cloudflare-workers",
"version": "2.7.1",
"version": "2.7.2",
"description": "Cloudflare worker request handler for Remix",
"bugs": {
"url": "https://github.com/remix-run/remix/issues"
Expand All @@ -16,7 +16,7 @@
"module": "dist/esm/index.js",
"dependencies": {
"@cloudflare/kv-asset-handler": "^0.1.3",
"@remix-run/cloudflare": "2.7.1"
"@remix-run/cloudflare": "2.7.2"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20230518.0",
Expand Down
7 changes: 7 additions & 0 deletions packages/remix-cloudflare/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@remix-run/cloudflare`

## 2.7.2

### Patch Changes

- Updated dependencies:
- `@remix-run/[email protected]`

## 2.7.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/remix-cloudflare/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/cloudflare",
"version": "2.7.1",
"version": "2.7.2",
"description": "Cloudflare platform abstractions for Remix",
"bugs": {
"url": "https://github.com/remix-run/remix/issues"
Expand All @@ -15,7 +15,7 @@
"typings": "dist/index.d.ts",
"dependencies": {
"@cloudflare/kv-asset-handler": "^0.1.3",
"@remix-run/server-runtime": "2.7.1"
"@remix-run/server-runtime": "2.7.2"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20230518.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/remix-css-bundle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# @remix-run/css-bundle

## 2.7.2

## 2.7.1

## 2.7.0
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-css-bundle/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/css-bundle",
"version": "2.7.1",
"version": "2.7.2",
"description": "CSS bundle href when using CSS bundling features in Remix",
"homepage": "https://remix.run",
"bugs": {
Expand Down
7 changes: 7 additions & 0 deletions packages/remix-deno/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@remix-run/deno`

## 2.7.2

### Patch Changes

- Updated dependencies:
- `@remix-run/[email protected]`

## 2.7.1

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/remix-deno/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/deno",
"version": "2.7.1",
"version": "2.7.2",
"description": "Deno platform abstractions for Remix",
"homepage": "https://remix.run",
"main": "./index.ts",
Expand All @@ -15,7 +15,7 @@
"license": "MIT",
"sideEffects": false,
"dependencies": {
"@remix-run/server-runtime": "2.7.1",
"@remix-run/server-runtime": "2.7.2",
"mime": "^3.0.0"
},
"peerDependencies": {
Expand Down
9 changes: 9 additions & 0 deletions packages/remix-dev/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# `@remix-run/dev`

## 2.7.2

### Patch Changes

- Vite: Fix error when building projects with `.css?url` imports ([#8829](https://github.com/remix-run/remix/pull/8829))
- Updated dependencies:
- `@remix-run/[email protected]`
- `@remix-run/[email protected]`

## 2.7.1

### Patch Changes
Expand Down
12 changes: 6 additions & 6 deletions packages/remix-dev/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/dev",
"version": "2.7.1",
"version": "2.7.2",
"description": "Dev tools and CLI for Remix",
"homepage": "https://remix.run",
"bugs": {
Expand Down Expand Up @@ -28,9 +28,9 @@
"@babel/types": "^7.22.5",
"@mdx-js/mdx": "^2.3.0",
"@npmcli/package-json": "^4.0.1",
"@remix-run/node": "2.7.1",
"@remix-run/node": "2.7.2",
"@remix-run/router": "1.15.1",
"@remix-run/server-runtime": "2.7.1",
"@remix-run/server-runtime": "2.7.2",
"@types/mdx": "^2.0.5",
"@vanilla-extract/integration": "^6.2.0",
"arg": "^5.0.1",
Expand Down Expand Up @@ -73,7 +73,7 @@
"ws": "^7.4.5"
},
"devDependencies": {
"@remix-run/serve": "2.7.1",
"@remix-run/serve": "2.7.2",
"@types/cacache": "^17.0.0",
"@types/cross-spawn": "^6.0.2",
"@types/gunzip-maybe": "^1.4.0",
Expand All @@ -91,11 +91,11 @@
"msw": "^1.2.3",
"strip-ansi": "^6.0.1",
"tiny-invariant": "^1.2.0",
"vite": "5.1.0",
"vite": "5.1.3",
"wrangler": "^3.28.2"
},
"peerDependencies": {
"@remix-run/serve": "^2.7.1",
"@remix-run/serve": "^2.7.2",
"typescript": "^5.1.0",
"vite": "^5.1.0",
"wrangler": "^3.28.2"
Expand Down
39 changes: 18 additions & 21 deletions packages/remix-dev/vite/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,22 @@ export const remixVitePlugin: RemixVitePlugin = (remixUserConfig = {}) => {
return JSON.parse(manifestContents) as Vite.Manifest;
};

let getViteManifestAssetPaths = (
viteManifest: Vite.Manifest
): Set<string> => {
// Get .css?url imports and CSS entry points
let cssUrlPaths = Object.values(viteManifest)
.filter((chunk) => chunk.file.endsWith(".css"))
.map((chunk) => chunk.file);

// Get bundled CSS files and generic asset types
let chunkAssetPaths = Object.values(viteManifest).flatMap(
(chunk) => chunk.assets ?? []
);

return new Set([...cssUrlPaths, ...chunkAssetPaths]);
};

let createBrowserManifestForBuild = async (): Promise<BrowserManifest> => {
let viteManifest = await loadViteManifest(
getClientBuildDirectory(ctx.remixConfig)
Expand Down Expand Up @@ -1238,27 +1254,8 @@ export const remixVitePlugin: RemixVitePlugin = (remixUserConfig = {}) => {
let ssrViteManifest = await loadViteManifest(serverBuildDirectory);
let clientViteManifest = await loadViteManifest(clientBuildDirectory);

let clientAssetPaths = new Set(
Object.values(clientViteManifest).flatMap((chunk) => [
...(chunk.css ?? []),
...(chunk.assets ?? []),
])
);

// Handle `.css?url` files that only exist in SSR module graph
let ssrCssUrlFilePaths = Object.values(ssrViteManifest)
.filter((chunk) => chunk.file.endsWith(".css"))
.map((chunk) => chunk.file);

// Handle generic assets that only exist in SSR module graph
let ssrChunkAssetPaths = Object.values(ssrViteManifest).flatMap(
(chunk) => chunk.assets ?? []
);

let ssrAssetPaths = new Set<string>([
...ssrCssUrlFilePaths,
...ssrChunkAssetPaths,
]);
let clientAssetPaths = getViteManifestAssetPaths(clientViteManifest);
let ssrAssetPaths = getViteManifestAssetPaths(ssrViteManifest);

// We only move assets that aren't in the client build, otherwise we
// remove them. These assets only exist because we explicitly set
Expand Down
2 changes: 2 additions & 0 deletions packages/remix-eslint-config/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# `@remix-run/eslint-config`

## 2.7.2

## 2.7.1

## 2.7.0
Expand Down
2 changes: 1 addition & 1 deletion packages/remix-eslint-config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-run/eslint-config",
"version": "2.7.1",
"version": "2.7.2",
"description": "ESLint configuration for Remix projects",
"bugs": {
"url": "https://github.com/remix-run/remix/issues"
Expand Down
7 changes: 7 additions & 0 deletions packages/remix-express/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# `@remix-run/express`

## 2.7.2

### Patch Changes

- Updated dependencies:
- `@remix-run/[email protected]`

## 2.7.1

### Patch Changes
Expand Down
Loading

0 comments on commit bc761d5

Please sign in to comment.