Releases: preactjs/wmr
wmr 2.2.0
Minor Changes
9d5b381
#627 Thanks @marvinhagemeister! - Add support for loading environment variables starting withWMR_
by default.
Patch Changes
-
c177752
#634 Thanks @marvinhagemeister! - Fix stray js config file when compiled with TypeScript -
cf6e5ce
#633 Thanks @cristianbote! - Adapt the newline regex rule to match any character range so unicode or other forms of chars chan be matched. -
352a5ef
#636 Thanks @rschristian! - Fixes the debug flag/messages for optimize-graph-plugin -
6d525e4
#631 Thanks @marvinhagemeister! - Fix unable to start when multiple config files in different formats are present. -
f1d41fe
#625 Thanks @rschristian! - Ensures TS wmr.config files are handled first -
93c93e9
#623 Thanks @rschristian! - WMR now transpiles wmr.config.ts to the correct module type for the app -
f9fcfe0
#628 Thanks @marvinhagemeister! - Ensure options.cwd is correct after plugin passes
wmr 2.1.0
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
-
7e3c2a7
#622 Thanks @marvinhagemeister! - Fix missing whitespace when JSXText spans multiple lines in prod -
36b927f
#612 Thanks @developit! - Upgrade to Terser 5 -
33a0fd7
#620 Thanks @marvinhagemeister! - Don't add defaultsrc/*
path mapping if we're using it as our public directory already.
wmr 2.0.2
Patch Changes
-
a0024d5
#607 Thanks @marvinhagemeister! - Fix flash of unstyled content (=FLOUT) by hoisting entry js CSS files into the HTML via a<link>
-tag -
08d66e3
#604 Thanks @rschristian! - Ensuring .d.ts files aren't copied to build output -
ba40f5c
#610 Thanks @rschristian! - Fixes some of WMR's CLI flags labelled as global when they're not
preact-iso 2.0.2
Patch Changes
c1f3f0e
#608 Thanks @marvinhagemeister! - FixuseRoute
missing in main entry exports
@wmrjs/directory-import 0.2.1
Patch Changes
d61db25
#600 Thanks @developit! - Fix directory plugin not resolving in prod builds
wmr 2.0.1
Patch Changes
0a9cbe8
#596 Thanks @rschristian! - WMR was published missing"type": "module"
which immediately broke new projects due to thewmr.config.mjs
preact-iso 2.0.1
Patch Changes
79c7fd6
#594 Thanks @developit! - Fixes a race condition in preact-isoRouter
by registering the link click handler immediately.
create-wmr 0.3.5
Patch Changes
6b59a90
#601 Thanks @marvinhagemeister! - Fix unable to load default template file
wmr 2.0.0
Major Changes
-
7561dc7
#576 Thanks @marvinhagemeister! - Rework prerendering API for tags indocument.head
. Previously the API is based on a subset of the actualdocument.head
object. But in supplying adocument
global we rendered third party library checks invalid which usually use a variant oftypeof 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 theprerender
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
-
c10f534
#585 Thanks @JoviDeCroock! - Support injecting prerender data by returning adata
key from the prerender function -
bb77f83
#574 Thanks @marvinhagemeister! - Add --debug flag as an alternative to DEBUG=true. It's easier on windows to pass a flag than to set an environment variable -
6e3bac1
#529 Thanks @marvinhagemeister! - Add defineConfig helper for better intellisense in config files
Patch Changes
-
ba2e29f
#575 Thanks @marvinhagemeister! - Don't attempt to prerender external script urls -
79496a3
#590 Thanks @marvinhagemeister! - Fix deeply nested CSS class not being hashed -
480d3b5
#578 Thanks @rschristian! - Instead of deleting the build output folder, it is instead emptied, allowing references to it to remain intact. -
01c4501
#569 Thanks @marvinhagemeister! - Allow plugins to pick any specifier for virtual modules
create-wmr 0.3.4
Patch Changes
-
56a5492
#584 Thanks @marvinhagemeister! - Switch from preact-iso subpackage imports to main import -
096e6a8
#579 Thanks @rschristian! - Bumping wmr template deps -
1183a41
#583 Thanks @marvinhagemeister! - Use Route components in create template to make it easier for potential TypeScript users