-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Use big object for constants #3628
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Ignored Deployment
|
Speaking of constants (and maybe this is piling on too much to this PR/discussion!) but I would really love this aspect of tldraw to be configurable when it comes to constants: Quote:
And also maybe it's overridable, maybe not 😬 I'm bringing it up because if we're gonna rework this it's worth considering how that would fit into the overall story here. |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Another go at #3628 & #3783. This moves (most) constants into `editor.options`, configurable by the `options` prop on the tldraw component. ### Change Type - [x] `sdk` — Changes the tldraw SDK - [x] `feature` — New feature ### Release Notes You can now override many options which were previously hard-coded constants. Pass an `options` prop into the tldraw component to change the maximum number of pages, grid steps, or other previously hard-coded values. See `TldrawOptions` for more
A recurring pattern with tldraw is that a user will want to configure something that we don't expect to be configurable. Often these are constant values, i.e. the drag distance or some timing or default. Some of these, such as our styles, can be configured by users because they're objects. They can be imported and mutated before the editor is created.
This PR moves all of our constants into one big object. (Well, technically two objects for the editor and tldraw packages).
Now all values, even primitive values, can be configured.
Change Type
sdk
— Changes the tldraw SDKfeature
Release Notes
editorConstants
andtldrawConstants