Skip to content

Version Packages#577

Merged
marvinhagemeister merged 1 commit intomainfrom
changeset-release/main
May 5, 2021
Merged

Version Packages#577
marvinhagemeister merged 1 commit intomainfrom
changeset-release/main

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot commented May 2, 2021

This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or setup this action to publish 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

wmr@2.0.0

Major Changes

  • 7561dc7 #576 Thanks @marvinhagemeister! - Rework prerendering API for tags in document.head. Previously the API is based on a subset of the actual document.head object. But in supplying a document global we rendered third party library checks invalid which usually use a variant of typeof document === "undefined" to determine if they're in a server environment or not. Since every library uses a different subset of the DOM API, it's impossible to support everyone. Instead using the server code paths of those libraries is a much more reliable approach.

    Any tags that should land in document.head can be added to the return value of the prerender function:

    export async function prerender(data) {
    	// ...do your prerendering here
    
    	return {
    		// The string that is put inside <body>
    		html: '<h1>Hello world</h1>',
    		head: {
    			// sets document.title
    			title: 'My Cool Title',
    			// Sets the lang attribute on the <html> element
    			lang: 'en',
    			// Any element you want to put into document.head
    			elements: [
    				{ type: 'link', props: { rel: 'stylesheet', href: '/path/to/my/style.css' } },
    				{ type: 'meta', props: { property: 'og:title', content: 'Become an SEO Expert' } }
    			]
    		}
    	};
    }

Minor Changes

Patch Changes

create-wmr@0.3.4

Patch Changes

@github-actions github-actions Bot force-pushed the changeset-release/main branch 13 times, most recently from 7654eb9 to cd6bf75 Compare May 5, 2021 06:23
@github-actions github-actions Bot force-pushed the changeset-release/main branch from cd6bf75 to ecdf2ec Compare May 5, 2021 07:32
@marvinhagemeister marvinhagemeister merged commit 00ed4e1 into main May 5, 2021
@marvinhagemeister marvinhagemeister deleted the changeset-release/main branch May 5, 2021 07:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant