marcospassos
Repos
38
Followers
65
Following
14

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.

13077
2755

PHP Runtime for ANTLR4

55
14

The easiest way to collect, manage, and consume real-time data to fuel personalized experiences.

103
14

React components and hooks to plug your React applications into Croct.

68
8

Events

opened issue
Service is apparently down

The packages and services unavailable seem unavailable.

image

Created at 13 hours ago
pull request opened
Fix UUID pattern

The currently UUID isn't exactly a general UUID matcher, but a variant-specific matcher.

For example, the NIL UUID doesn't match, although it's a valid, UUID as defined in the UUID spec. Also, restricting the version and variant isn't exactly right, since using other hex digit is valid, meaning the version and variant are unknown. Even the most used UUID library in the PHP ecosystem, or the native UUID in Java, doesn't impose such restrictions.

Created at 1 day ago
create branch
marcospassos create branch fix/uuid
Created at 1 day ago
Created at 1 day ago
create tag
marcospassos create tag 0.10.2
Created at 5 days ago
delete tag
marcospassos delete tag 0.10.2
Created at 5 days ago
create tag
marcospassos create tag 0.10.2
Created at 5 days ago
pull request closed
Bump SDK version and update docs

Summary

  • Just update the expression the expression lenght to 500 characters.

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules
  • [x] I have checked my code and corrected any misspellings
Created at 5 days ago

Update documentation (#132)

Created at 5 days ago
create tag
marcospassos create tag 0.10.0
Created at 5 days ago

Update max expression lenght (#255)

Created at 5 days ago
pull request closed
Update max expression lenght

Summary

Please include a summary of the change and which issue is addressed.

  • Update the max limit of expression lenght to 500.

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules
  • [x] I have checked my code and corrected any misspellings
Created at 5 days ago
opened issue
Traits and spurious errors

Bug report

I understand that traits are not analyzed in isolation, but could PHPStan somehow not report these errors from a protected method?

Code snippet that reproduces the problem

https://phpstan.org/r/b396231d-7152-4f6a-b2eb-f1a57517544f

Expected output

No errors.

Did PHPStan help you today? Did it make you happy in any way?

We 💚 PHPStan!

Created at 1 week ago
Created at 1 week ago
Created at 1 week ago
opened issue
Date time components

Motivation

Date and time pickers are one of the most missing components in the library. React Aria provides great, decoupled primitives that we could use to save a lot of time with parsing and formatting.

Usage example

The React Aria is a great inspiration: https://react-spectrum.adobe.com/react-aria/useDatePicker.html

Requirements

  • Support single date selection
  • Support date range selection
  • Support time in different zones

Workaround

No response

Possible implementations

No response

Created at 1 week ago
opened issue
Bad error reporting for value objects

In our code base, we have several value objects for representing IDs, like WorkspaceId, OrganizationId, etc. When mapping a value where such ids were expected, Valinor yields poor unuseful messages like:

Cannot be empty and must be filled with a value matching type ?.

I understand that exposing the class name isn't a good idea for security reasons. However, currently, there is no way to handle such cases:

  • The originally expected type isn't retained, so we can't just inspect the parameters
  • All messages are flagged as @internal, so we can't rely on it to check if it's one of these cases to override the message
  • There's no feature that allows providing labels for such type so Valinor can take care of it

I think Valinor should take advantage of the ICU select construct to remove those confusing parts:

{expected_type, select,
  `?` {Cannot be empty}
   other {Cannot be empty and must match type {expected_type}}
}
Created at 2 weeks ago
Created at 2 weeks ago
issue comment
Failed to drag when address bar is hidden(Ios 15 safari)

Same case here.

Created at 2 weeks ago
pull request closed
Update CSE challenge description

  • Update HomeBanner slot payload to correct schema.

  • I've been receiving lots of questions about the challenge goal, reading description I've noticed that the main goal was somewhat hidden. I've moved it to a more privileged position.


Created at 2 weeks ago

Update CSE challenge description (#22)

Created at 2 weeks ago
Created at 2 weeks ago
issue comment
Bidirectional type narrowing for generic types (would close an obscure hole in type checking!)

Hack solves this with the solution I give there, but I'm hesitant to copy that implementation because the type hole is a pretty small edge-case

We've several cases like the one I've shared in a single application and dozens throughout the codebase. I don't think it's uncommon at all.

Created at 3 weeks ago
started
Created at 3 weeks ago
Created at 3 weeks ago
Fix nested error reporting

@georgekaran , this is a terrible but functional workaround for the issue:

import {ValidationError} from "yup";
import {yupResolver as baseResolver} from "@hookform/resolvers/yup";
import BaseSchema from "yup/lib/schema";

/**
 * Workaround for https://github.com/react-hook-form/resolvers/issues/441
 */

function fixErrorNesting(errors: Record<string, any>): Record<string, any> | any[] {
  const fieldErrors: Record<string, any> = {};

  for (const [key, value] of Object.entries(errors)) {
    if (typeof value !== 'object' || value === null) {
      fieldErrors[key] = value;

      continue;
    }

    if (Array.isArray(value)) {
      fieldErrors[key] = value.map(fixErrorNesting);

      continue;
    }

    if (!('0' in value)) {
      fieldErrors[key] = fixErrorNesting(value);

      continue;
    }

    const copy = {...value}
    const list = [];

    let index = 0;

    while (index in copy) {
      list.push(fixErrorNesting(copy[index]));
      delete copy[index];
      index++;
    }

    Object.assign(list, copy);

    fieldErrors[key] = list;
  }

  return fieldErrors;
}

export const yupResolver: typeof baseResolver = (schema, schemaOptions = {}, resolverOptions = {}) => {
  const schemaClone = (schema as any).clone() as BaseSchema;

  const validate = schemaClone.validate.bind(schemaClone);
  const validateSync = schemaClone.validateSync.bind(schemaClone);

  function fixError<T>(error: T): T {
    if (error instanceof ValidationError) {
      error.inner.sort((left, right) => {
        if (left.path === right.path) {
          return 0;
        }

        return (left.path ?? '') > (right.path ?? '') ? 1 : -1
      });
    }

    return error;
  }

  schemaClone.validate = async (...args) => {
    try {
      return await validate(...args);
    } catch (error) {
      throw fixError(error);
    }
  };

  schemaClone.validateSync = (...args) => {
    try {
      return validateSync(...args);
    } catch (error) {
      throw fixError(error);
    }
  };

  const resolver = baseResolver(schemaClone as typeof schema, schemaOptions, resolverOptions);

  return async (values, context, options) => {
      const result = await resolver(values, context, options);

      return {
        ...result,
        errors: fixErrorNesting(result.errors) as typeof result.errors,
      }
  };
};

It should definitely be fixed.

Created at 1 month ago
Fix nested error reporting

The problem is that there is no easy way to fix or monkey patch this other than maintaining a fork. Also, this is a real feature bug for those who use the all criteria.

Created at 1 month ago

Adjust table order (#131)

Created at 1 month ago
pull request closed
Adjust table order

Summary

  • Reordenate rows that weren't being clear enough in a JSON context:
| Property             | type     |
|----------------------|----------|
| order                | Object   |
| order.items[*].index | string   |
| order.id             | string   | 
| order.items[*].sku   | string   |

doesn't reflect the order of this JSON:

{
   order: {
       id: 'foo',
       items: [...],
   }
}

A cleaner table would be:

| Property             | type     |
|----------------------|----------|
| order                | Object   |
| order.id             | string   | 
| order.items[*].index | string   |
| order.items[*].sku   | string   |

  • Correct typos.

  • Correct descriptions.

Checklist

  • [x] My code follows the style guidelines of this project
  • [x] I have performed a self-review of my own code
  • [x] I have commented my code, particularly in hard-to-understand areas
  • [x] I have made corresponding changes to the documentation
  • [x] My changes generate no new warnings
  • [x] I have added tests that prove my fix is effective or that my feature works
  • [x] New and existing unit tests pass locally with my changes
  • [x] Any dependent changes have been merged and published in downstream modules
  • [x] I have checked my code and corrected any misspellings
Created at 1 month ago
issue comment
Check if querySelectorAll is supported

Agreed!

Created at 1 month ago