Skip to content

Commit

Permalink
hotfix for bundled react-reconciler imports in esm bundle (#2161)
Browse files Browse the repository at this point in the history
* fix esm

* changeset
  • Loading branch information
jeetiss authored Jan 28, 2023
1 parent cbb5001 commit f648581
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .changeset/smooth-cameras-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@react-pdf/renderer': patch
---

fix esm reexports
2 changes: 1 addition & 1 deletion packages/renderer/rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const getPlugins = ({ browser, minify = false }) => [
sourceMaps(),
...(browser ? [ignore(['fs', 'path', 'url'])] : []),
babel(babelConfig()),
commonjs(),
commonjs({ esmExternals: true, requireReturnsDefault: 'namespace' }),
nodeResolve({ browser, preferBuiltins: !browser }),
replace({
preventAssignment: true,
Expand Down
10 changes: 3 additions & 7 deletions packages/renderer/src/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
/* eslint-disable no-param-reassign */

import ReactFiberReconciler from 'react-reconciler';
import {
unstable_scheduleCallback as schedulePassiveEffects,
unstable_cancelCallback as cancelPassiveEffects,
} from 'scheduler';
import * as scheduler from 'scheduler';

import propsEqual from './utils/propsEqual';

Expand Down Expand Up @@ -34,9 +31,8 @@ const appendChild = (parentInstance, child) => {

const createRenderer = ({ onChange = () => {} }) => {
return ReactFiberReconciler({
schedulePassiveEffects,

cancelPassiveEffects,
schedulePassiveEffects: scheduler.unstable_scheduleCallback,
cancelPassiveEffects: scheduler.unstable_cancelCallback,

supportsMutation: true,

Expand Down

0 comments on commit f648581

Please sign in to comment.