Add SSR/SSG rendering support for Ember Vite apps#21201
Add SSR/SSG rendering support for Ember Vite apps#21201
Conversation
- Add @ember/server-rendering package with renderToHTML() and prerender() APIs - Update v2-app-template with SSR entry points (entry-server.js, entry-client.js, entry-prerender.js) - Add Vite SSR dev server (server.js) - Update config/environment.js for SSR (no document in Node.js) - Update deprecation-workflow.js with browser guard - Update vite.config.mjs with SSR noExternal config - Add SSR integration tests (all 8 passing) Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
There was a problem hiding this comment.
lol what is going on here
There was a problem hiding this comment.
Fixed in 4e852be. The issues were:
async/await— banned bydisable-features/disable-async-await; replaced with.then()chainsconstinside functions — banned byember-internal/no-const-outside-module-scope; replaced withletglobalThis— not in the ESLint globals forpackages/**/*.js; replaced withwindow(which is declared) sinceentry-server.jsalready polyfillswindow = globalThisin Node- JSDoc format — the
ember-internal/require-yuidoc-accessrule expects@public/@privatewithout a leading*per line (Ember's YUIDoc style); switched to that format - Also renamed
patchQuerySelectorAll→patchSimpleDocumentfor clarity
|
@copilot lots of tests fail -- try again |
- Replace async/await with Promise.then() chains (disable-features/disable-async-await) - Replace const inside functions with let (ember-internal/no-const-outside-module-scope) - Replace globalThis with window (no-undef; window is declared in ESLint globals for packages/**) - Use Ember-style JSDoc format (no leading * per line) so @public/@Private are detected by ember-internal/require-yuidoc-access - Rename patchQuerySelectorAll to patchSimpleDocument for clarity Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Fixed in 4e852be — the |
📊 Package size report 0.02%↑
🤖 This report was automatically generated by pkg-size-action |
|
@copilot fix linting (never forget this), and add an SSR test to the node smoke test |
- Fix lint:docs: convert patchSimpleDocument from YUIDoc block comment to plain comment so yuidoc doesn't pick it up as a classitem - Add @module @ember/server-rendering and @for declarations so the module and its public methods are properly documented - Add prerender, renderToHTML to tests/docs/expected.js classitems - Add @ember/server-rendering to tests/docs/expected.js modules - Add SSR smoke test to smoke-tests/node-template/tests/node/ssr-test.js testing _renderMode: 'serialize' produces Glimmer rehydration markers - Add ember-source: workspace:* to node-template package.json for proper linking Co-authored-by: NullVoxPopuli <199018+NullVoxPopuli@users.noreply.github.com>
Fixed in 1d8279f. Linting — the
Node smoke test — added
Also added |
packages/@ember/server-rendering/package withrenderToHTMLandprerenderAPIs@ember/server-rendering/index.js(18 errors → 0)lint:docsfailure:patchSimpleDocumenthelper@module @ember/server-renderingdeclaration and@forannotationsprerender,renderToHTMLtotests/docs/expected.jsclassitems@ember/server-renderingtotests/docs/expected.jsmodulessmoke-tests/node-template/tests/node/ssr-test.js)_renderMode: 'serialize'produces Glimmer rehydration markers (<!--%...%-->)ember-source: workspace:*tosmoke-tests/node-template/package.json@ember/server-renderingto the pnpm workspacesmoke-tests/v2-app-templatefor SSR support (config, entries, server, tests)💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.