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

feat: new @maskito/solid library #1668

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

Conversation

Tommypop2
Copy link

@Tommypop2 Tommypop2 commented Sep 22, 2024

I've tried to keep the API as close to the react version as possible.
Creating as a draft PR for now as I haven't figured out testing yet.

I'm happy to make any changes if required! :)

Copy link
Member

@nsbarsukov nsbarsukov left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution ❤️

I know nothing about solid-js.
My apologies, if I've suggested something stupid or irrelevant 😄

Comment on lines +9 to +11
"scripts": {
"start": "jiti ./src/index.ts",
"build": "tsup"
Copy link
Member

Choose a reason for hiding this comment

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

We use Nx tools to build all Maskito's libraries.
Let's use Nx for the new library too.

"jiti": "^1.21.0",
"solid-js": "^1.8.22",
"tsup": "^8.0.2",
"typescript": "^5.3.3"
Copy link
Member

Choose a reason for hiding this comment

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

TypeScript is already mentioned in the root package.json:

"typescript": "5.0.4",

},
"devDependencies": {
"jiti": "^1.21.0",
"solid-js": "^1.8.22",
Copy link
Member

Choose a reason for hiding this comment

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

Should we also add solid-js to peerDependencies ?

@@ -0,0 +1,19 @@
{
"name": "@maskito/solid",
"version": "0.0.1",
Copy link
Member

Choose a reason for hiding this comment

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

Sync its version with other Maskito's libraries

"name": "@maskito/solid",
"version": "0.0.1",
"description": "",
"license": "MIT",
Copy link
Member

Choose a reason for hiding this comment

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

Change license to Apache (similar to all other Maskito's packages):

"license": "Apache-2.0",

"version": "0.0.1",
"description": "",
"license": "MIT",
"author": "",
Copy link
Member

Choose a reason for hiding this comment

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

You can add your name here

"author": {
    "name": "Thomas <your surname>",
    "email": "<your email>",
    "url": "https://github.com/Tommypop2"
},

@@ -0,0 +1 @@
dist
Copy link
Member

Choose a reason for hiding this comment

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

Probably, it should be removed migration to Nx tooling

type Setter,
} from 'solid-js';

export const useMaskito = ({
Copy link
Member

Choose a reason for hiding this comment

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

React has the rule: "Hook names always start with use".

Does Solid have the same rule too ?
If no, we should rethink this naming (it should be started with maskito word).

}: {
options?: MaskitoOptions | null;
elementPredicate?: MaskitoElementPredicate;
} = {}): Setter<HTMLElement | null> => {
Copy link
Member

@nsbarsukov nsbarsukov Sep 23, 2024

Choose a reason for hiding this comment

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

Does Soild have directive concept ?
If yes, let's use it (see @maskito/angular & @maskito/vue as examples).

I am not sure but probably Solid has it:
https://docs.solidjs.com/reference/jsx-attributes/use#use

Copy link
Member

Choose a reason for hiding this comment

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

import {maskito} from '@maskito/solid';
// [...]
<input type="text" use:maskito={[options, predicate]} />

Copy link
Contributor

Choose a reason for hiding this comment

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

If directive is an option we should definitely go for it.

Copy link
Member

Choose a reason for hiding this comment

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

Could you add documentation page ?
See this page as example:

https://maskito.dev/frameworks/vue

@nsbarsukov nsbarsukov added the community contribution This issue was closed by a PR from the community label Sep 23, 2024
@nsbarsukov nsbarsukov changed the title Add Solid Integration Library feat: new @maskito/solid library Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community contribution This issue was closed by a PR from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants