Skip to content

Releases: preactjs/wmr

wmr 2.2.0

21 May 07:53
cee091a
Compare
Choose a tag to compare

Minor Changes

Patch Changes

wmr 2.1.0

13 May 19:15
1b5852f
Compare
Choose a tag to compare

Minor Changes

  • 10df8bb #619 Thanks @marvinhagemeister! - Deprecate "aliases" configuration in favor of "alias" to have a consistent name across various frontend tools. The "aliases" property will continue to work, but a deprecation warning will be printed to the console.

    export default {
    -	aliases: {
    +	alias: {
    		react: 'preact/compat'
    	}
    };
  • d907131 #552 Thanks @marvinhagemeister! - Add support for importing files outside of the main public directory. This feature is based on aliases and <project>/src is added by default. To prevent unexpected file access only the directories defined in the aliases and the public directory are allowed to read files from. To alias a new path add the following to your WMR configuration file:

    // File: wmr.config.mjs
    import { defineConfig } from 'wmr';
    
    export default defineConfig({
    	alias: {
    		// This will alias "~" to "<project>/src/components/"
    		'~/*': './src/components/'
    	}
    });

Patch Changes

wmr 2.0.2

10 May 09:16
d42b187
Compare
Choose a tag to compare

Patch Changes

preact-iso 2.0.2

10 May 09:15
d42b187
Compare
Choose a tag to compare

Patch Changes

@wmrjs/directory-import 0.2.1

10 May 09:15
d42b187
Compare
Choose a tag to compare

Patch Changes

wmr 2.0.1

06 May 19:45
800e2ab
Compare
Choose a tag to compare

Patch Changes

  • 0a9cbe8 #596 Thanks @rschristian! - WMR was published missing "type": "module" which immediately broke new projects due to the wmr.config.mjs

preact-iso 2.0.1

06 May 19:44
800e2ab
Compare
Choose a tag to compare

Patch Changes

  • 79c7fd6 #594 Thanks @developit! - Fixes a race condition in preact-iso Router by registering the link click handler immediately.

create-wmr 0.3.5

06 May 20:02
1de2d7e
Compare
Choose a tag to compare

Patch Changes

wmr 2.0.0

05 May 07:37
00ed4e1
Compare
Choose a tag to compare

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

05 May 07:37
00ed4e1
Compare
Choose a tag to compare

Patch Changes