Compare commits

..

6 Commits

Author SHA1 Message Date
Vercel Release Bot
91b7f6dcd9 Version Packages (#9973)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## vercel@29.3.4

### Patch Changes

- Updated dependencies
\[[`67e556bc8`](67e556bc80),
[`ba10fb4dd`](ba10fb4dd4)]:
    -   @vercel/remix-builder@1.8.9
    -   @vercel/next@3.8.4

## @vercel/next@3.8.4

### Patch Changes

- Update handling for react prebundled flag
([#9974](https://github.com/vercel/vercel/pull/9974))

## @vercel/remix-builder@1.8.9

### Patch Changes

- Upgrade `@remix-run/dev` fork to v1.16.1
([#9971](https://github.com/vercel/vercel/pull/9971))

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-05-18 10:38:24 -07:00
JJ Kasper
ba10fb4dd4 [next] Update handling for react prebundled flag (#9974)
This ensures we properly set the prebundled react flag conditionally for
app and pages ensuring they are kept separate when bundling.

x-ref: https://github.com/vercel/next.js/issues/49169
2023-05-18 06:37:50 -07:00
Nathan Rajlich
18c1c45ce3 Add changeset for @remix-run/dev updater GH Action (#9972)
Adds a changeset file when the GH Action to update `@remix-run/dev`
creates a pull request.
2023-05-17 16:39:09 -07:00
Vercel Release Bot
67e556bc80 [remix] Upgrade @remix-run/dev to version 1.16.1 (#9971)
This auto-generated PR updates @remix-run/dev to version 1.16.1
2023-05-17 19:34:12 +00:00
Sean Massa
7235000181 fix release script (#9959)
The [previous PR](https://github.com/vercel/vercel/pull/9942) used `github.repos`, but I think this needs to be `github.rest.repos`.

- [Docs](https://octokit.github.io/rest.js/v19#repos)
- [Failed GH Action](https://github.com/vercel/vercel/actions/runs/4994578940/jobs/8945329301)
2023-05-17 18:26:30 +00:00
Sean Massa
5124d431ea fix deploy from local (#9969)
Local deployments of this repo would fail because this repo assumes that it's only ever deployed via git connection.
2023-05-17 17:45:28 +00:00
19 changed files with 730 additions and 553 deletions

View File

@@ -1,5 +1,13 @@
# vercel
## 29.3.4
### Patch Changes
- Updated dependencies [[`67e556bc8`](https://github.com/vercel/vercel/commit/67e556bc80c821c233120a2ec1611adb8e195baa), [`ba10fb4dd`](https://github.com/vercel/vercel/commit/ba10fb4dd4155a75df79b98a0c43a6c42eac7b62)]:
- @vercel/remix-builder@1.8.9
- @vercel/next@3.8.4
## 29.3.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "29.3.3",
"version": "29.3.4",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -35,11 +35,11 @@
"@vercel/build-utils": "6.7.2",
"@vercel/go": "2.5.1",
"@vercel/hydrogen": "0.0.64",
"@vercel/next": "3.8.3",
"@vercel/next": "3.8.4",
"@vercel/node": "2.14.2",
"@vercel/python": "3.1.60",
"@vercel/redwood": "1.1.15",
"@vercel/remix-builder": "1.8.8",
"@vercel/remix-builder": "1.8.9",
"@vercel/ruby": "1.3.76",
"@vercel/static-build": "1.3.30"
},

View File

@@ -1,5 +1,11 @@
# @vercel/next
## 3.8.4
### Patch Changes
- Update handling for react prebundled flag ([#9974](https://github.com/vercel/vercel/pull/9974))
## 3.8.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "3.8.3",
"version": "3.8.4",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",

View File

@@ -386,7 +386,7 @@ export async function serverBuild({
const apiPages: string[] = [];
const nonApiPages: string[] = [];
const streamingPages: string[] = [];
const appRouterPages: string[] = [];
lambdaPageKeys.forEach(page => {
if (
@@ -401,15 +401,20 @@ export async function serverBuild({
if (nonLambdaSsgPages.has(pathname)) {
return;
}
const normalizedPathname = normalizePage(pathname);
if (isDynamicRoute(pathname)) {
dynamicPages.push(normalizePage(pathname));
if (isDynamicRoute(normalizedPathname)) {
dynamicPages.push(normalizedPathname);
}
if (pageMatchesApi(page)) {
apiPages.push(page);
} else if (appDir && lambdaAppPaths[page]) {
streamingPages.push(page);
} else if (
(appPathRoutesManifest?.[`${normalizedPathname}/page`] ||
appPathRoutesManifest?.[`${normalizedPathname}/route`]) &&
lambdaAppPaths[page]
) {
appRouterPages.push(page);
} else {
nonApiPages.push(page);
}
@@ -570,6 +575,15 @@ export async function serverBuild({
`${getNextServerPath(nextVersion)}/next-server.js`
);
const appLauncher = launcher.replace(
'// pre-next-server-target',
`process.env.__NEXT_PRIVATE_PREBUNDLED_REACT = "${
requiredServerFilesManifest.config?.experimental?.serverActions
? 'experimental'
: 'next'
}"`
);
if (
entryDirectory !== '.' &&
path.posix.join('/', entryDirectory) !== routesManifest.basePath
@@ -585,10 +599,6 @@ export async function serverBuild({
);
}
const launcherFiles: { [name: string]: FileFsRef | FileBlob } = {
[path.join(path.relative(baseDir, projectDir), '___next_launcher.cjs')]:
new FileBlob({ data: launcher }),
};
const pageTraces: {
[page: string]: { [key: string]: FileFsRef };
} = {};
@@ -597,7 +607,7 @@ export async function serverBuild({
} = {};
const mergedPageKeys = [
...nonApiPages,
...streamingPages,
...appRouterPages,
...apiPages,
...internalPages,
];
@@ -758,10 +768,10 @@ export async function serverBuild({
pageExtensions,
});
const streamingPageLambdaGroups = await getPageLambdaGroups({
const appRouterLambdaGroups = await getPageLambdaGroups({
entryPath: projectDir,
config,
pages: streamingPages,
pages: appRouterPages,
prerenderRoutes,
pageTraces,
compressedPages,
@@ -773,10 +783,11 @@ export async function serverBuild({
pageExtensions,
});
for (const group of streamingPageLambdaGroups) {
for (const group of appRouterLambdaGroups) {
if (!group.isPrerenders) {
group.isStreaming = true;
}
group.isAppRouter = true;
}
const apiLambdaGroups = await getPageLambdaGroups({
@@ -812,7 +823,7 @@ export async function serverBuild({
pseudoLayerBytes: group.pseudoLayerBytes,
uncompressedLayerBytes: group.pseudoLayerUncompressedBytes,
})),
streamingPageLambdaGroups: streamingPageLambdaGroups.map(group => ({
appRouterLambdaGroups: appRouterLambdaGroups.map(group => ({
pages: group.pages,
isPrerender: group.isPrerenders,
pseudoLayerBytes: group.pseudoLayerBytes,
@@ -826,7 +837,7 @@ export async function serverBuild({
);
const combinedGroups = [
...pageLambdaGroups,
...streamingPageLambdaGroups,
...appRouterLambdaGroups,
...apiLambdaGroups,
];
@@ -905,6 +916,10 @@ export async function serverBuild({
}
}
const launcherFiles: { [name: string]: FileFsRef | FileBlob } = {
[path.join(path.relative(baseDir, projectDir), '___next_launcher.cjs')]:
new FileBlob({ data: group.isAppRouter ? appLauncher : launcher }),
};
const operationType = getOperationType({ group, prerenderManifest });
const lambda = await createLambdaFromPseudoLayers({

View File

@@ -18,6 +18,8 @@ if (process.env.NODE_ENV !== 'production' && region !== 'dev1') {
process.env.NODE_ENV = 'production';
}
// pre-next-server-target
// eslint-disable-next-line
const NextServer = require('__NEXT_SERVER_PATH__').default;
const nextServer = new NextServer({

View File

@@ -1350,6 +1350,7 @@ export type LambdaGroup = {
pages: string[];
memory?: number;
maxDuration?: number;
isAppRouter?: boolean;
isStreaming?: boolean;
isPrerenders?: boolean;
isApiLambda: boolean;

View File

@@ -0,0 +1,18 @@
"use client";
import react from 'react'
export const MoreData = () => {
const [mounted, setMounted] = react.useState(false)
react.useEffect(() => {
setMounted(true)
}, [])
return (
<>
<p>more data</p>
{mounted && <p>mounted!</p>}
</>
)
}

View File

@@ -0,0 +1,3 @@
import react from 'react'
export const DataContext = react.createContext(null)

View File

@@ -0,0 +1,28 @@
import react from 'react'
import { MoreData } from '../../components/more-data'
import { DataContext } from '../../data-context'
const ValueItem = () => {
const value = react.useContext(DataContext)
return <p>{value}</p>
}
export default function Page(props) {
return (
<>
<DataContext.Provider value={'hello context'}>
<p>hello from pages/blog-ssr/[slug]</p>
<ValueItem />
<MoreData />
</DataContext.Provider>
</>
);
}
export function getServerSideProps() {
return {
props: {
now: Date.now()
}
}
}

View File

@@ -160,6 +160,16 @@
"status": 200,
"mustContain": "hello from pages/blog/[slug]"
},
{
"path": "/blog-ssr/123",
"status": 200,
"mustContain": "hello from pages/blog-ssr/[slug]"
},
{
"path": "/blog-ssr/321",
"status": 200,
"mustContain": "hello context"
},
{
"path": "/dynamic/category-1/id-1",
"status": 200,

View File

@@ -72,7 +72,7 @@ if (parseInt(process.versions.node.split('.')[0], 10) >= 16) {
)
).toBeFalsy();
expect(lambdas.size).toBe(3);
expect(lambdas.size).toBe(4);
expect(buildResult.output['dashboard']).toBeDefined();
expect(buildResult.output['dashboard/another']).toBeDefined();
expect(buildResult.output['dashboard/changelog']).toBeDefined();

View File

@@ -48,11 +48,13 @@ async function main() {
fs.remove(join(outDir, 'serverless-functions/serverless-handler.d.mts')),
]);
// Copy type file for ts test
await fs.copyFile(
join(outDir, 'index.d.ts'),
join(__dirname, 'test/fixtures/15-helpers/ts/types.d.ts')
);
if (process.env.CI) {
// Copy type file for ts test
await fs.copyFile(
join(outDir, 'index.d.ts'),
join(__dirname, 'test/fixtures/15-helpers/ts/types.d.ts')
);
}
await fs.copyFile(
join(__dirname, 'src/edge-functions/edge-handler-template.js'),

View File

@@ -1,5 +1,11 @@
# @vercel/remix-builder
## 1.8.9
### Patch Changes
- Upgrade `@remix-run/dev` fork to v1.16.1 ([#9971](https://github.com/vercel/vercel/pull/9971))
## 1.8.8
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/remix-builder",
"version": "1.8.8",
"version": "1.8.9",
"license": "Apache-2.0",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
@@ -20,7 +20,7 @@
"defaults"
],
"dependencies": {
"@remix-run/dev": "npm:@vercel/remix-run-dev@1.16.0-patch.1",
"@remix-run/dev": "npm:@vercel/remix-run-dev@1.16.1",
"@vercel/build-utils": "6.7.2",
"@vercel/nft": "0.22.5",
"@vercel/static-config": "2.0.17",

1089
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

19
utils/pack.ts vendored
View File

@@ -6,9 +6,8 @@ import { TurboDryRun } from './types';
const rootDir = path.join(__dirname, '..');
async function main() {
const { stdout: sha } = await execa('git', ['rev-parse', '--short', 'HEAD'], {
cwd: rootDir,
});
const sha = await getSha();
const { stdout: turboStdout } = await execa(
'turbo',
['run', 'build', '--dry=json'],
@@ -50,6 +49,20 @@ async function main() {
}
}
async function getSha(): Promise<string> {
try {
const { stdout } = await execa('git', ['rev-parse', '--short', 'HEAD'], {
cwd: rootDir,
});
return stdout;
} catch (error) {
console.error(error);
console.log('Assuming this is not a git repo. Using "local" as the SHA.');
return 'local';
}
}
main().catch(err => {
console.log('error running pack:', err);
process.exit(1);

View File

@@ -1,6 +1,6 @@
module.exports = async ({ github, context }) => {
const { owner, repo } = context.repo;
const response = await github.repos.listReleases({ owner, repo });
const response = await github.rest.repos.listReleases({ owner, repo });
function isVercelCliRelease(release) {
return release.tag_name.startsWith('vercel@');
@@ -15,7 +15,7 @@ module.exports = async ({ github, context }) => {
const latestVercelRelease = response.data.find(isVercelCliRelease);
console.log(`Promoting "${latestVercelRelease.tag_name}" to latest release`);
await github.repos.updateRelease({
await github.rest.repos.updateRelease({
owner,
repo,
release_id: latestVercelRelease.id,

View File

@@ -7,7 +7,8 @@ module.exports = async ({ github, context }, newVersion) => {
execSync('git config --global user.name vercel-release-bot');
execSync('git checkout main');
const packagePath = path.join(__dirname, '..', 'packages', 'remix');
const repoRootPath = path.join(__dirname, '..');
const packagePath = path.join(repoRootPath, 'packages', 'remix');
const oldVersion = JSON.parse(
fs.readFileSync(path.join(packagePath, 'package.json'), 'utf-8')
).dependencies['@remix-run/dev'];
@@ -42,6 +43,17 @@ module.exports = async ({ github, context }, newVersion) => {
{ cwd: packagePath }
);
const changesetName = path.join(repoRootPath, `.changeset/${branch}.md`);
fs.writeFileSync(
changesetName,
`---
'@vercel/remix-builder': patch
---
Update \`@remix-run/dev\` fork to v${newVersion}
`
);
execSync(`git checkout -b ${branch}`);
execSync('git add -A');
execSync(`git commit -m ${branch}`);
@@ -54,8 +66,8 @@ module.exports = async ({ github, context }, newVersion) => {
repo,
head: branch,
base: 'main',
title: `[remix] Upgrade @remix-run/dev to version ${newVersion}`,
body: `This auto-generated PR updates @remix-run/dev to version ${newVersion}`,
title: `[remix] Update \`@remix-run/dev\` to v${newVersion}`,
body: `This auto-generated PR updates \`@remix-run/dev\` to version ${newVersion}.`,
});
await github.rest.issues.addLabels({