Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/head-no-server-write.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/meta": patch
---

`<Head>` no longer writes a signal during server render, so dev SSR stops logging `[SERVER_WRITE]` for every page that uses it (#80). The server reads the group's tags when its boundary flushes, so the write did nothing there.
2 changes: 1 addition & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"mode": "pre",
"mode": "exit",
"tag": "next",
"initialVersions": {
"@solidjs/meta": "0.30.0-next.0"
Expand Down
5 changes: 5 additions & 0 deletions .changeset/solid-export-condition.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/meta": patch
---

Add a `solid` export condition so `@solidjs/vite-plugin` (through vitefu) bundles `@solidjs/meta` in SSR instead of leaving it external. Left external, Node loaded it against the production `solid-js` server build while the app ran on the dev build, and the two owner stacks threw `NoOwnerError` in dev SSR (#74).
7 changes: 7 additions & 0 deletions .changeset/solid-meta-2-0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@solidjs/meta": major
---

Solid Meta 2.0.0, the stable release for Solid 2.0. The version jumps to 2.0.0 to match `solid-js`, `@solidjs/web` and `@solidjs/router`: the `1.0.0-next.*` prereleases were this same line, and there is no stable 1.x. For Solid 1.x stay on `@solidjs/meta` 0.29.x.

Peer dependencies are now `solid-js` / `@solidjs/web` `^2.0.0`.
23 changes: 17 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,19 @@ on:
push:
branches:
- main
- next

concurrency: ${{ github.workflow }}-${{ github.ref }}

permissions:
contents: write
pull-requests: write
# npm trusted publishing (OIDC): the release job mints a short-lived npm
# credential from the workflow's identity, so no NPM_TOKEN secret is needed.
# The trusted publisher registered on npmjs.com must name this repo and this
# workflow file (release.yml) or the publish fails with E403/E404.
id-token: write

jobs:
release:
name: Release
Expand All @@ -16,14 +26,13 @@ jobs:
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
with:
# https://github.com/pnpm/pnpm/issues/8953
version: 9.15.3

- name: Use Node.js from nvmrc
# Node 24 (npm >= 11.5.1) for the publish: OIDC trusted publishing
# needs a newer npm than the .nvmrc toolchain (Node 22 / npm 10) ships.
- name: Setup Node.js 24.x
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
node-version: 24.x
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
Expand All @@ -36,4 +45,6 @@ jobs:
publish: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
# Provenance attestation for the published tarball; requires the
# OIDC id-token permission above.
NPM_CONFIG_PROVENANCE: 'true'
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ name: Tests
on:
workflow_dispatch:
push:
branches: [main]
branches: [main, next]
pull_request:
branches: [main]
branches: [main, next]

jobs:
test:
Expand All @@ -22,8 +22,6 @@ jobs:

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9

- name: Install dependencies
run: pnpm install
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Document head management for Solid — declare `<title>`, `<meta>`, `<link>`, an

> | Solid version | @solidjs/meta version |
> | --- | --- |
> | Solid 2.x | 1.x |
> | Solid 2.x | 2.x |
> | Solid 1.x | 0.27.x – 0.29.x |
> | Solid 0.x | 0.26.x |

Expand All @@ -20,7 +20,7 @@ npm i @solidjs/meta

## How it works

Solid Meta 1.x is a thin component layer over Solid 2.0's built-in head
Solid Meta 2.x is a thin component layer over Solid 2.0's built-in head
registry (`useHead` in `@solidjs/web`). There is **no provider** — the
registry is ambient. Render a head component anywhere and it registers under
the current reactive owner:
Expand Down Expand Up @@ -140,15 +140,15 @@ useHead([ /* an array is a group — one replacement set */ ]);
useHead(() => tags()); // a function is a reactive group
```

## Migrating from 0.x
## Migrating from 0.x (Solid 1)

1. **Delete `<MetaProvider>`.** The registry is ambient; the provider and
`MetaContext` no longer exist.
2. **Delete server plumbing.** No more `tags={[]}` array and no
`getAssets()` — rendering the document splices the head automatically
(use the `onHead` render option if you assemble HTML yourself).
3. **Duplicate-tag semantics changed.** 0.x kept multiple `<Meta>`s with the
same `name` if their other attributes differed; 1.x dedupes by
same `name` if their other attributes differed; 2.x dedupes by
`name`/`property`/`http-equiv` (+ `media`) with last-wins. For deliberate
sets (multiple `og:image`s), wrap them in `<Head>`; to fork an identity,
give each tag a distinct `key`.
Expand Down
28 changes: 17 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@solidjs/meta",
"description": "Write meta tags to the document head",
"version": "1.0.0-next.2",
"version": "2.0.0-next.2",
"author": "Ryan Carniato",
"license": "MIT",
"repository": {
Expand All @@ -14,7 +14,11 @@
"type": "module",
"main": "dist/index.js",
"exports": {
".": "./dist/index.js"
".": {
"types": "./dist/index.d.ts",
"solid": "./dist/index.js",
"default": "./dist/index.js"
}
},
"types": "dist/index.d.ts",
"files": [
Expand All @@ -32,20 +36,22 @@
"release": "pnpm build && changeset publish"
},
"peerDependencies": {
"solid-js": "^2.0.0-rc.0",
"@solidjs/web": "^2.0.0-rc.0"
"solid-js": "^2.0.0",
"@solidjs/web": "^2.0.0"
},
"devDependencies": {
"@changesets/cli": "^2.28.1",
"@solidjs/web": "^2.0.0-rc.0",
"@solidjs/web": "^2.0.0",
"@testing-library/jest-dom": "^6.6.3",
"@types/jest": "^29.5.14",
"@vitest/browser": "^3.1.1",
"jsdom": "^26.0.0",
"rimraf": "^6.0.1",
"solid-js": "^2.0.0-rc.0",
"solid-js": "^2.0.0",
"typescript": "5.8.3",
"@solidjs/vite-plugin": "3.0.0-next.28",
"vitest": "^3.1.1"
}
"@solidjs/vite-plugin": "3.0.0-next.57",
"vitest": "^4.1.11",
"vite": "^8.2.2",
"@babel/core": "^7.26.0",
"@types/node": "^22.14.1"
},
"packageManager": "pnpm@10.28.0"
}
Loading
Loading