NotLuksus
NotLuksus
Explore posts from servers
SSolidJS
Created by NotLuksus on 8/20/2024 in #support
Weird Context Behaviour
Alright, using split props fixed it. Why is that tho? Is a page evaluated from bottom to top / children to parents in Solid? Which now that I think about would make sense
10 replies
SSolidJS
Created by NotLuksus on 8/20/2024 in #support
Weird Context Behaviour
However when I render <EditorRoot> <EditorBubble ...> </EditorRoot> I get "useEditor must be used within an EditorProvider", which I defined in the context.ts, but I don't get why
10 replies
SSolidJS
Created by NotLuksus on 8/20/2024 in #support
Weird Context Behaviour
import { isNodeSelection } from "@tiptap/core";
import {
BubbleMenuWrapper,
type BubbleMenuWrapperProps,
} from "@vrite/tiptap-solid";
import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
import { useCurrentEditor } from "../utils/context";


export const EditorBubble = (props: EditorBubbleProps): JSX.Element => {
const editor = useCurrentEditor();
let instanceRef: Instance<Props> | null = null;

createEffect(() => {
if (!instanceRef || !props.tippyOptions?.placement) return;

instanceRef.setProps({ placement: props.tippyOptions.placement });
instanceRef.popperInstance?.update();
});

// const bubbleMenuProps: Omit<BubbleMenuWrapperProps, "children">

const memo = createMemo(() => {
const shouldShow: BubbleMenuWrapperProps["shouldShow"] = ({
editor,
state,
}) => {
const { selection } = state;
const { empty } = selection;

// don't show bubble menu if:
// - the editor is not editable
// - the selected node is an image
// - the selection is empty
// - the selection is a node selection (for drag handles)
if (
!editor.isEditable ||
editor.isActive("image") ||
empty ||
isNodeSelection(selection)
) {
return false;
}
return true;
};

return {
shouldShow,
tippyOptions: {
onCreate: (val: Instance<Props>) => {
instanceRef = val;
},
moveTransition: "transform 0.15s ease-out",
...props.tippyOptions,
},
...props,
};
});

const bubbleMenuProps: Omit<BubbleMenuWrapperProps, "editor" | "children"> =
memo();

if (!editor) return null;

return (
// We need to add this because of https://github.com/ueberdosis/tiptap/issues/2658
<div>
<BubbleMenuWrapper {...bubbleMenuProps} editor={editor}>
{props.children}
</BubbleMenuWrapper>
</div>
);
};

export default EditorBubble;
import { isNodeSelection } from "@tiptap/core";
import {
BubbleMenuWrapper,
type BubbleMenuWrapperProps,
} from "@vrite/tiptap-solid";
import { createEffect, createMemo, onCleanup, onMount } from "solid-js";
import { useCurrentEditor } from "../utils/context";


export const EditorBubble = (props: EditorBubbleProps): JSX.Element => {
const editor = useCurrentEditor();
let instanceRef: Instance<Props> | null = null;

createEffect(() => {
if (!instanceRef || !props.tippyOptions?.placement) return;

instanceRef.setProps({ placement: props.tippyOptions.placement });
instanceRef.popperInstance?.update();
});

// const bubbleMenuProps: Omit<BubbleMenuWrapperProps, "children">

const memo = createMemo(() => {
const shouldShow: BubbleMenuWrapperProps["shouldShow"] = ({
editor,
state,
}) => {
const { selection } = state;
const { empty } = selection;

// don't show bubble menu if:
// - the editor is not editable
// - the selected node is an image
// - the selection is empty
// - the selection is a node selection (for drag handles)
if (
!editor.isEditable ||
editor.isActive("image") ||
empty ||
isNodeSelection(selection)
) {
return false;
}
return true;
};

return {
shouldShow,
tippyOptions: {
onCreate: (val: Instance<Props>) => {
instanceRef = val;
},
moveTransition: "transform 0.15s ease-out",
...props.tippyOptions,
},
...props,
};
});

const bubbleMenuProps: Omit<BubbleMenuWrapperProps, "editor" | "children"> =
memo();

if (!editor) return null;

return (
// We need to add this because of https://github.com/ueberdosis/tiptap/issues/2658
<div>
<BubbleMenuWrapper {...bubbleMenuProps} editor={editor}>
{props.children}
</BubbleMenuWrapper>
</div>
);
};

export default EditorBubble;
10 replies
SSolidJS
Created by NotLuksus on 5/14/2024 in #support
Shared Layouts with SolidStart
Yeah that worked, thank you!
3 replies
SSolidJS
Created by NotLuksus on 5/14/2024 in #support
createAsyncResource and <Suspense>
or is it always instantly
8 replies
SSolidJS
Created by NotLuksus on 5/14/2024 in #support
createAsyncResource and <Suspense>
is there a way to tell it when to start streaming?
8 replies
SSolidJS
Created by NotLuksus on 5/14/2024 in #support
createAsyncResource and <Suspense>
good to know, seems reasonable tho
8 replies
SSolidJS
Created by NotLuksus on 5/14/2024 in #support
createAsyncResource and <Suspense>
Lmao, that works, my bad, thought defer stream would do the opposite, read another thread wrong then. Thanks a lot!
8 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 4/10/2024 in #questions
trpc/react not working on AWS
Or switch it to the non streaming variant
28 replies
TTCTheo's Typesafe Cult
Created by shikishikichangchang on 4/10/2024 in #questions
trpc/react not working on AWS
Ran into a similar issues a while ago make sure to enable streaming on your lambda as the trpc client is batchLinkStreaming I believe
28 replies
TTCTheo's Typesafe Cult
Created by NotLuksus on 12/7/2023 in #questions
Use @monaco-editor/react as a tsx editor
Yeah I figured it out, basically what you need todo is fetch the react types and add them to your monaco editor by creating a new model in the react folder named index.d.ts and inside there save the @types/react index.d.ts
8 replies
TTCTheo's Typesafe Cult
Created by NotLuksus on 12/18/2023 in #questions
Errors while running mutations when deploying CT3A using SST
hmmm im pretty sure you just need to enable streaming on your lambda
13 replies
TTCTheo's Typesafe Cult
Created by NotLuksus on 12/18/2023 in #questions
Errors while running mutations when deploying CT3A using SST
Are you using sst?
13 replies
TTCTheo's Typesafe Cult
Created by NotLuksus on 12/18/2023 in #questions
Errors while running mutations when deploying CT3A using SST
you can read about it here: https://trpc.io/docs/client/links/httpBatchStreamLink The batch links in trpc are so that instead of having to sent 10 requests to the server it only needs to sent 1. Streaming means that the responses don't come back all at once when they finished, but start streaming in over time, so if 1 of the requests is really fast it doesnt have to wait for the others to finish
13 replies
TTCTheo's Typesafe Cult
Created by Circus on 11/27/2023 in #questions
Clerk Webhooks with Prisma (Sync database, user model)
The webhook isn't called by a user but from clerks servers, any redirects should happen for the client that makes these calls
30 replies
TTCTheo's Typesafe Cult
Created by ibby on 12/19/2023 in #questions
nextjs how to render serverside and then update data client-side based on a filter?
yeah query params might be the easiest here, for the checkbox you can just use something like ?filter=true no?
3 replies
TtRPC
Created by NotLuksus on 12/18/2023 in #❓-help
Errors while running mutations when deploying CT3A using SST
Solution is enabling streaming since ct3a uses the httpBatchStream link
5 replies