-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add just-in-time rendering, TypeScript support and improved API
BREAKING CHANGE: Changes to webpackStats passed to mapStatsToParams and new plugin API. See [MIGRATION_GUIDE_v1_to_v2.md](./MIGRATION_GUIDE_v1_to_v2.md) for more information. **Features** - Add ability to create an Express Middleware to perform just-in-time rendering during development - Add support for skipping rendering files at end of build - Add support for *transformExpressPath* to much like *transformFilePath* - Add support for manually calling renders with *renderWhenReady* - Add TypeScript support **Changes** - Migrate to usage based naming.`htmlRenderPlugin.statsCollectorPlugin` for stat collection and `rendererPlugin` for rendering. - Deprecate previous `render()` syntax - Rewrite in Typescript. - Rewrite in functional syntax. Still uses Class syntax to reduce breaking changes. - Remove deprecated *multiCompiler* apply capability - Pass *webpackStats* through by default to render function - Removed *render* build from being added to *webpackStats* by default. This is now an opt-in behaviour - Removed *verbose* option. Migrated to [debug](https://www.npmjs.com/package/debug) for debug logging.
- Loading branch information
1 parent
a953ce9
commit 203a21b
Showing
56 changed files
with
3,476 additions
and
2,264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
node_modules | ||
/node_modules/ | ||
.git | ||
yarn.lock | ||
/yarn-error.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Migration Guide v1.x to v2.x | ||
|
||
## WebpackStats nolonger includes the render config by default. | ||
|
||
```js | ||
plugins: [htmlRenderPlugin.rendererPlugin]; | ||
``` | ||
|
||
To recreate the previous behaviour pass the stats collector to render config | ||
|
||
```js | ||
plugins: [ | ||
htmlRenderPlugin.statsCollectorPlugin, | ||
htmlRenderPlugin.rendererPlugin | ||
]; | ||
``` | ||
|
||
Where builds have two configurations (client and render) this will now mean your stats file will be a standard Stats file and not a MultiStats file. | ||
|
||
## Remove Support for "Alternative multiple configuration setup" | ||
|
||
This method was deprecated in the previous major release and has now been removed. | ||
|
||
Example: | ||
|
||
```js | ||
new HtmlRenderPlugin().apply(multiCompiler); | ||
``` | ||
|
||
## Deprecate the calling of `render()` and passing in the plugin directly | ||
|
||
This syntax is still supported until the next major release but the prefered syntax is listed below. | ||
|
||
**Render** | ||
|
||
Before: | ||
|
||
```js | ||
htmlRenderPlugin.render(); | ||
``` | ||
|
||
After: | ||
|
||
```js | ||
htmlRenderPlugin.rendererPlugin; | ||
``` | ||
|
||
**Client** | ||
|
||
Before: | ||
|
||
```js | ||
htmlRenderPlugin; | ||
``` | ||
|
||
After: | ||
|
||
```js | ||
htmlRenderPlugin.statsCollectorPlugin; | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
module.exports = { | ||
testEnvironment: "node", | ||
transform: {}, | ||
watchPathIgnorePatterns: ["/dist/"] | ||
watchPathIgnorePatterns: ["/dist/"], | ||
preset: "ts-jest" | ||
}; |
Oops, something went wrong.