@kaliber/build 0.0.143 → 0.0.145

Sign up to get free protection for your applications and to get access to all the features.
package/lib/build.js CHANGED
@@ -69,7 +69,7 @@ const babelLoader = {
69
69
  cacheDirectory: './.babelcache/',
70
70
  cacheCompression: false,
71
71
  babelrc: false, // this needs to be false, any other value will cause .babelrc to interfere with these settings
72
- presets: [['@babel/preset-react', { 'runtime': 'automatic' }]],
72
+ presets: ['@babel/preset-react'],
73
73
  plugins: [
74
74
  ['@babel/plugin-proposal-decorators', { legacy: true }],
75
75
  ['@babel/plugin-proposal-class-properties', { loose: true }],
@@ -45,7 +45,13 @@ export function hydrate(component, { nodes: initialNodes, startNode, endNode })
45
45
  const container = createVirtualReactContainer({ initialNodes, startNode, endNode })
46
46
  const root = hydrateRoot(container, component)
47
47
 
48
- return { update: x => root.render(x) }
48
+ return {
49
+ update(newComponent) {
50
+ root.unmount()
51
+ root = createRoot(container)
52
+ root.render(newComponent)
53
+ }
54
+ }
49
55
  }
50
56
 
51
57
  function createVirtualReactContainer({ initialNodes, startNode, endNode }) {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.143",
2
+ "version": "0.0.145",
3
3
  "name": "@kaliber/build",
4
4
  "description": "Zero configuration, opinionated webpack / react build setup",
5
5
  "scripts": {