Skip to content

Commit

Permalink
Release 29.3.3 prep
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlandsman committed Apr 25, 2023
1 parent 03ad1d4 commit 8dc4015
Show file tree
Hide file tree
Showing 12 changed files with 42 additions and 10 deletions.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion grid-community-modules/react/bundles/ag-grid-react.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions grid-community-modules/react/lib/reactUi/agGridReactUi.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions grid-community-modules/react/lib/reactUi/utils.d.ts
Expand Up @@ -7,6 +7,10 @@ export declare class CssClasses {
toString(): string;
}
export declare const isComponentStateless: (Component: any) => boolean;
export declare const FlushSyncToggle: {
on: () => boolean;
off: () => boolean;
};
/**
* Wrapper around flushSync to provide backwards compatibility with React 16-17
* @param fn
Expand Down
13 changes: 11 additions & 2 deletions grid-community-modules/react/lib/reactUi/utils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion grid-community-modules/react/lib/reactUi/utils.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion grid-packages/ag-grid-react/bundles/ag-grid-react.min.js

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions grid-packages/ag-grid-react/lib/reactUi/agGridReactUi.js
Expand Up @@ -54,6 +54,7 @@ var newReactComponent_1 = require("../shared/newReactComponent");
var portalManager_1 = require("../shared/portalManager");
var gridComp_1 = __importDefault(require("./gridComp"));
var reactFrameworkOverrides_1 = require("../shared/reactFrameworkOverrides");
var utils_1 = require("./utils");
function debug(msg, obj) {
// console.log(msg, obj);
}
Expand All @@ -80,6 +81,8 @@ var AgGridReactUi = /** @class */ (function (_super) {
if (this.state.context) {
this.renderedAfterMount = true;
}
utils_1.FlushSyncToggle.off();
setTimeout(function () { return utils_1.FlushSyncToggle.on(); }, 0);
return (react_1.default.createElement("div", { style: this.createStyleForDiv(), className: this.props.className, ref: this.eGui },
this.state.context && react_1.default.createElement(gridComp_1.default, { context: this.state.context }),
this.portalManager.getPortals()));
Expand Down
4 changes: 4 additions & 0 deletions grid-packages/ag-grid-react/lib/reactUi/utils.d.ts
Expand Up @@ -7,6 +7,10 @@ export declare class CssClasses {
toString(): string;
}
export declare const isComponentStateless: (Component: any) => boolean;
export declare const FlushSyncToggle: {
on: () => boolean;
off: () => boolean;
};
/**
* Wrapper around flushSync to provide backwards compatibility with React 16-17
* @param fn
Expand Down
13 changes: 11 additions & 2 deletions grid-packages/ag-grid-react/lib/reactUi/utils.js
Expand Up @@ -15,7 +15,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.agFlushSync = exports.isComponentStateless = exports.CssClasses = exports.classesList = void 0;
exports.agFlushSync = exports.FlushSyncToggle = exports.isComponentStateless = exports.CssClasses = exports.classesList = void 0;
var react_dom_1 = __importDefault(require("react-dom"));
exports.classesList = function () {
var list = [];
Expand Down Expand Up @@ -64,13 +64,22 @@ exports.isComponentStateless = function (Component) {
};
// CreateRoot is only available from React 18, which if used requires us to use flushSync.
var createRootAndFlushSyncAvailable = react_dom_1.default.createRoot != null && react_dom_1.default.flushSync != null;
var agFlushSyncActive = true;
exports.FlushSyncToggle = {
on: function () { return agFlushSyncActive = true; },
off: function () { return agFlushSyncActive = false; }
};
// Avoid using nested flushSync calls, as this causes error messages in the console.
var activeFlushSyncs = 0;
/**
* Wrapper around flushSync to provide backwards compatibility with React 16-17
* @param fn
*/
exports.agFlushSync = function (fn) {
if (createRootAndFlushSyncAvailable) {
if (createRootAndFlushSyncAvailable && agFlushSyncActive && activeFlushSyncs === 0) {
activeFlushSyncs++;
react_dom_1.default.flushSync(fn);
activeFlushSyncs--;
}
else {
fn();
Expand Down

0 comments on commit 8dc4015

Please sign in to comment.