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: immutable records according to designs (wip) #984

Merged
merged 9 commits into from
Oct 9, 2023

Conversation

barthuijgen
Copy link
Contributor

@barthuijgen barthuijgen commented Oct 4, 2023

This pull request adds work in progress on immutable records app. I want to make this PR now to avoid it becoming even larger.

The app was already set up as a nextjs project, this PR adds

  • Styled home page for immutable records
  • Integrating needed components, styling and modal functionality
  • Code for wallet connect but this is not used in the UI yet

@vercel
Copy link

vercel bot commented Oct 4, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
immutable-records ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 6, 2023 8:25am
4 Ignored Deployments
Name Status Preview Comments Updated (UTC)
alpha-docs ⬜️ Ignored (Inspect) Visit Preview Oct 6, 2023 8:25am
docs-storybook ⬜️ Ignored (Inspect) Visit Preview Oct 6, 2023 8:25am
react-ui ⬜️ Ignored (Inspect) Visit Preview Oct 6, 2023 8:25am
tools ⬜️ Ignored (Inspect) Visit Preview Oct 6, 2023 8:25am

@changeset-bot
Copy link

changeset-bot bot commented Oct 4, 2023

🦋 Changeset detected

Latest commit: 471aea9

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

))}
</div>
</main>
<div className={yearsSidebar}>
Copy link
Contributor

Choose a reason for hiding this comment

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

een

tag?

},
]);

export const main = style([
sprinkles({
margin: '$4',
Copy link
Contributor

Choose a reason for hiding this comment

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

hm..als je overal gewoon 'px' gebruikt. zou ik dat bij deze denk ik ook doen.
je zit zover van de react-ui af, dan zou ik het eigenlijk helemaal niet gebruiken.
anders veranderd opeens deze variabele en klopt er niets van je design.

ik zou wel aan vanilla extract vasthouden, want dat gebruiken we nu overal

Copy link
Contributor

Choose a reason for hiding this comment

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

isa heeft een npm package '@kadena/fonts' ofzo. daar kun je de kodemono mee gebruiken in css.
het zit ook al in react-ui (font-family: 'mono')

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I checked out trying to use @kadena/fonts together with Isa, but it does not work well with next.js appdir. It is not able to load the font until javascript is executed causing it to pop-in after pageload. Using nextjs's font helper gives the best performance, but it was not compatible with the @kadena/fonts package.

Copy link
Contributor

@webpro webpro left a comment

Choose a reason for hiding this comment

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

Small-ish PRs are great, but maybe still give a short description what is included?

'@typescript-eslint/strict-boolean-expressions': 'off',
// TODO: eslint in vscode does not understand tsconfig paths and gives errors
// even though in the build it works fine
'import/no-unresolved': 'off',
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like a good opportunity to have something of a shared app ESLint config, or extend the existing next config.

Those profiles are here: https://github.com/kadena-community/kadena.js/tree/main/packages/tools/eslint-config/profile

This specific import/no-unresolved should not need to be disabled, this works well in the other packages too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But I'm already extending next via @kadena-dev/eslint-config/profile/next right?
Also next extends react and react extends lib, so when I use next I automatically opt-in to all the lib rules too

Copy link
Contributor Author

@barthuijgen barthuijgen Oct 5, 2023

Choose a reason for hiding this comment

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

Also about the import/no-unresolved I think it's specifically the eslint extension in vscode that is missing how to read some configuration, I'm assuming because it's a monorepo and it by default tries to read configs in the root? When I open packages/apps/immutable-records as a new workspace it has no issues.

Copy link
Contributor

Choose a reason for hiding this comment

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

But I'm already extending next via @kadena-dev/eslint-config/profile/next right? Also next extends react and react extends lib, so when I use next I automatically opt-in to all the lib rules too

True. Multiple packages are doing something similar, so perhaps we could share more rules, e.g. some kind of shared next or app ruleset.

Also about the import/no-unresolved I think it's specifically the eslint extension in nextjs that is missing how to read some configuration, I'm assuming because it's a monorepo and it by default tries to read configs in the root? When I open packages/apps/immutable-records as a new workspace it has no issues.

Not sure what causes the issue, but import/no-unresolved is an important rule. It does not only resolve your local imports, but also external ones. I think it might catch issues that would not fail the build, only to surface at runtime.

Copy link
Contributor

Choose a reason for hiding this comment

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

By the way, it would be fine to create a new ticket to look into all of this later. But either should be fixed here or handled properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Found the solution, you have to configure "eslint.workingDirectories": ["./packages/apps/immutable-records"] in ./vscode/settings.json
Where I just have this app now, but ideally any directory that has a .eslintrc.* is added, really don't know why they don't just resolve these configs automatically but okay, this does work.

@@ -3,6 +3,7 @@
"compilerOptions": {
"rootDir": "./",
"types": ["node", "@types/gtag.js"],
"lib": ["ES2022", "DOM"],
Copy link
Contributor

Choose a reason for hiding this comment

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

See comment about shared profiles for ESLint.

@@ -39,6 +47,8 @@
"@vanilla-extract/next-plugin": "2.3.1",
"eslint": "^8.45.0",
"eslint-config-next": "13.4.5",
"lokijs": "^1.5.12",
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this dependency being used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lokijs and pino-pretty were both required by @walletconnect/modal and @walletconnect/sign-client, it gives build errors when I did not add these, seems like a bug on their side. It's dev-dependencies anyway, I don't think its a big deal right now.

@@ -39,6 +47,8 @@
"@vanilla-extract/next-plugin": "2.3.1",
"eslint": "^8.45.0",
"eslint-config-next": "13.4.5",
"lokijs": "^1.5.12",
"pino-pretty": "^10.2.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

What is this dependency being used for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

see comment on lokijs, these two have the same reason.

open,
onClose,
}) => {
useEventListener('keydown', (e) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we really need another dependency to use addEventListener?

Copy link
Contributor Author

@barthuijgen barthuijgen Oct 9, 2023

Choose a reason for hiding this comment

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

usehooks-ts provides many useful utilities for react apps at a 4kb gziped size. I don't think there should be much reason to have to justify a package of that size if it makes us have to write and maintain less code.

@barthuijgen barthuijgen merged commit 06c9556 into main Oct 9, 2023
6 checks passed
@barthuijgen barthuijgen deleted the feat/immutable-records-app branch October 9, 2023 12:33
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.

3 participants