Skip to content
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

fix: compile-time configurable NY-delimiter #266

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShubhranshuSanjeev
Copy link
Collaborator

Problem

Describe the problem you are trying to solve here

Solution

Provide a brief summary of your solution so that reviewers can understand your code

Environment variable changes

What ENVs need to be added or changed

Pre-deployment activity

Things needed to be done before deploying this change (if any)

Post-deployment activity

Things needed to be done after deploying this change (if any)

API changes

Endpoint Method Request body Response Body
API GET/POST, etc request response

Possible Issues in the future

Describe any possible issues that could occur because of this change

@ayushjain17
Copy link
Collaborator

Lets not label anything with ny and lets keep it a generic feature (no matter for what short time period we would be keeping this feature)

where
NF: Fn(Option<String>) + 'static + Clone,
{
#[prop(into)] on_folder_click: Callback<Option<String>, ()>,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the advantage of Callback over the generic function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Saves us from writing clone() everywhere, handled internally by Leptos when we actually use the value.
Callback internally uses StoredValue which is just an id to memory arena (something similar) in leptos. Makes it easy to use in move closures.

Comment on lines 15 to 20

#[cfg(feature = "ny-delimiter")]
const GROUPING_DELIMITER: &[char] = &['.', ':'];

#[cfg(not(feature = "ny-delimiter"))]
const GROUPING_DELIMITER: &[char] = &['.'];
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const GROUPING_DELIMITER: &[char] = if cfg!(feature = "ny-delimiter") { &['.', ':'] } else { &['.'] };
Something like this can be done?
And agreed with @ayushjain17 , lets not label it with NY or anything specific.

@ShubhranshuSanjeev ShubhranshuSanjeev force-pushed the fix/delimiter branch 2 times, most recently from 1ed5722 to fd251d9 Compare October 19, 2024 06:21
@@ -234,7 +246,7 @@ impl Display for RegexEnum {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let regex = match self {
Self::DefaultConfigKey => ALPHANUMERIC_WITH_DOT,
Self::DimensionName => ALPHANUMERIC_WITH_DOT,
Self::DimensionName => ALPHANUMERIC_WITHOUT_DOT,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are we changing this ?
we do intend to allow dimension names like {key1}.{key2}

@Datron
Copy link
Collaborator

Datron commented Oct 21, 2024

Write a proper PR description

@ayushjain17
Copy link
Collaborator

we would need changes in Makefile as well, right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants