-
Notifications
You must be signed in to change notification settings - Fork 6
Upgrade to React 18.2.0 #43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| diff --git a/node_modules/@blueprintjs/core/lib/esm/components/alert/alert.d.ts b/node_modules/@blueprintjs/core/lib/esm/components/alert/alert.d.ts | ||
| index 09b06be..f74f6a3 100644 | ||
| --- a/node_modules/@blueprintjs/core/lib/esm/components/alert/alert.d.ts | ||
| +++ b/node_modules/@blueprintjs/core/lib/esm/components/alert/alert.d.ts | ||
| @@ -5,6 +5,7 @@ import { IOverlayLifecycleProps } from "../overlay/overlay"; | ||
| export declare type AlertProps = IAlertProps; | ||
| /** @deprecated use AlertProps */ | ||
| export interface IAlertProps extends IOverlayLifecycleProps, Props { | ||
| + children?: React.ReactNode; | ||
| /** | ||
| * Whether pressing <kbd>escape</kbd> when focused on the Alert should cancel the alert. | ||
| * If this prop is enabled, then either `onCancel` or `onClose` must also be defined. | ||
| diff --git a/node_modules/@blueprintjs/core/lib/esm/components/dialog/dialog.d.ts b/node_modules/@blueprintjs/core/lib/esm/components/dialog/dialog.d.ts | ||
| index e90ee31..3e4f4ef 100644 | ||
| --- a/node_modules/@blueprintjs/core/lib/esm/components/dialog/dialog.d.ts | ||
| +++ b/node_modules/@blueprintjs/core/lib/esm/components/dialog/dialog.d.ts | ||
| @@ -6,6 +6,7 @@ import { IBackdropProps, OverlayableProps } from "../overlay/overlay"; | ||
| export declare type DialogProps = IDialogProps; | ||
| /** @deprecated use DialogProps */ | ||
| export interface IDialogProps extends OverlayableProps, IBackdropProps, Props { | ||
| + children?: React.ReactNode; | ||
| /** | ||
| * Toggles the visibility of the overlay and its children. | ||
| * This prop is required because the component is controlled. | ||
| diff --git a/node_modules/@blueprintjs/core/lib/esm/components/tabs/tabs.d.ts b/node_modules/@blueprintjs/core/lib/esm/components/tabs/tabs.d.ts | ||
| index 2ca5fe5..870a32e 100644 | ||
| --- a/node_modules/@blueprintjs/core/lib/esm/components/tabs/tabs.d.ts | ||
| +++ b/node_modules/@blueprintjs/core/lib/esm/components/tabs/tabs.d.ts | ||
| @@ -6,6 +6,7 @@ export declare const Expander: React.FunctionComponent; | ||
| export declare type TabsProps = ITabsProps; | ||
| /** @deprecated use TabsProps */ | ||
| export interface ITabsProps extends Props { | ||
| + children?: React.ReactNode; | ||
| /** | ||
| * Whether the selected tab indicator should animate its movement. | ||
| * | ||
| diff --git a/node_modules/@blueprintjs/core/lib/esm/components/tooltip/tooltip.d.ts b/node_modules/@blueprintjs/core/lib/esm/components/tooltip/tooltip.d.ts | ||
| index 94f4af9..4db48a9 100644 | ||
| --- a/node_modules/@blueprintjs/core/lib/esm/components/tooltip/tooltip.d.ts | ||
| +++ b/node_modules/@blueprintjs/core/lib/esm/components/tooltip/tooltip.d.ts | ||
| @@ -6,6 +6,7 @@ import { IPopoverSharedProps } from "../popover/popoverSharedProps"; | ||
| export declare type TooltipProps = ITooltipProps; | ||
| /** @deprecated use TooltipProps */ | ||
| export interface ITooltipProps extends IPopoverSharedProps, IntentProps { | ||
| + children?: React.ReactNode; | ||
| /** | ||
| * The content that will be displayed inside of the tooltip. | ||
| */ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| diff --git a/node_modules/@blueprintjs/select/lib/esm/components/select/select.d.ts b/node_modules/@blueprintjs/select/lib/esm/components/select/select.d.ts | ||
| index f8b9bc6..ee0b6da 100644 | ||
| --- a/node_modules/@blueprintjs/select/lib/esm/components/select/select.d.ts | ||
| +++ b/node_modules/@blueprintjs/select/lib/esm/components/select/select.d.ts | ||
| @@ -4,6 +4,7 @@ import { IListItemsProps } from "../../common"; | ||
| export declare type SelectProps<T> = ISelectProps<T>; | ||
| /** @deprecated use SelectProps */ | ||
| export interface ISelectProps<T> extends IListItemsProps<T> { | ||
| + children?: React.ReactNode; | ||
| /** | ||
| * Whether the component should take up the full width of its container. | ||
| * This overrides `popoverProps.fill`. You also have to ensure that the child |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,6 +12,7 @@ import runExtension from "./util/runExtension"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import { createBlock } from "./writes"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import MenuItemSelect from "./components/MenuItemSelect"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| import TimePanel from "./components/ConfigPanels/TimePanel"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // const blockRender = (Component: React.FC) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| // const block = window.roamAlphaAPI.ui.getFocusedBlock(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -214,6 +215,47 @@ const components = [ | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label: "PageInput", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| callback: () => | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| rootRender(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const [value] = useState(new Date()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const [uid, setUid] = useState<string>(""); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| React.useEffect(() => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const createUid = async () => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const currentPageUid = | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| (await window.roamAlphaAPI.ui.mainWindow.getOpenPageOrBlockUid()) || | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| window.roamAlphaAPI.util.dateToPageUid(new Date()); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!currentPageUid) throw new Error("No current page uid"); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| console.log(currentPageUid); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| const newUid = await createBlock({ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| parentUid: currentPageUid, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| node: { text: "time-field" }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| setUid(newUid); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| createUid(); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, []); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+224
to
+239
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Add error handling for block creation. The async block creation should handle potential failures gracefully. React.useEffect(() => {
const createUid = async () => {
+ try {
const currentPageUid =
(await window.roamAlphaAPI.ui.mainWindow.getOpenPageOrBlockUid()) ||
window.roamAlphaAPI.util.dateToPageUid(new Date());
if (!currentPageUid) throw new Error("No current page uid");
const newUid = await createBlock({
parentUid: currentPageUid,
node: { text: "time-field" },
});
setUid(newUid);
+ } catch (error) {
+ console.error("Failed to create block:", error);
+ // Consider setting an error state or fallback behavior
+ }
};
createUid();
}, []);📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if (!uid) return <div>Loading...</div>; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| return ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <div>Selected time: {value.toLocaleTimeString()}</div> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| <TimePanel | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| title="time-field" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| uid={uid} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| parentUid="test-parent-uid" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Replace hardcoded test value with dynamic or configurable value. The hardcoded - parentUid="test-parent-uid"
+ parentUid={currentPageUid}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| order={0} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| description="Select a time" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| defaultValue={value} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| </> | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| label: "TimePanel", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ]; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| export default runExtension(async (args) => { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -229,6 +271,7 @@ export default runExtension(async (args) => { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FormDialog, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| PageInput, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| renderToast, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| TimePanel, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| util: { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| renderOverlay, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
React and TypeScript definitions upgraded consistently.
The upgrade to React 18.2.0 with matching TypeScript definitions is properly coordinated.
Also applies to: 43-44
🌐 Web query:
💡 Result:
As of August 3, 2025, the latest stable version of React is 19.1.0, released on March 28, 2025. (github.com) React 18.2.0, released on June 14, 2022, is not the latest stable version.
Regarding security vulnerabilities, Snyk reports that the latest version, 19.1.1, has no known vulnerabilities. (security.snyk.io) However, earlier versions, such as 0.0.1 to 0.13.0, have been identified with cross-site scripting (XSS) vulnerabilities. It's important to note that these vulnerabilities are present in older versions and have been addressed in subsequent releases.
Therefore, to ensure your application remains secure, it's recommended to use the latest stable version of React, which currently is 19.1.0.
Citations:
Upgrade React and TypeScript definitions to latest stable (19.1.0)
React 18.2.0 is no longer the latest stable release. As of August 2025, React 19.1.0 is the current stable version with no known security vulnerabilities. Please update both React and its TypeScript definitions to keep dependencies secure and up-to-date.
Areas to update in package.json:
"@types/react","@types/react-dom")"react","react-dom")Suggested diff:
📝 Committable suggestion
🤖 Prompt for AI Agents