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: [SC-24987] create LoadingReportIcon #282

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

Copy link

vercel bot commented Jun 1, 2024

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

Name Status Preview Comments Updated (UTC)
examples.nameguard.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 6:40pm
nameguard.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 6:40pm
namehashlabs.org ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 6:40pm
storybook.namekit.io ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 12, 2024 6:40pm

Copy link

changeset-bot bot commented Jun 1, 2024

🦋 Changeset detected

Latest commit: bc4192d

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

This PR includes changesets to release 3 packages
Name Type
@namehash/nameguard-react Minor
@namehash/nameguard Minor
@namehash/nameguard-js Patch

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

Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@FrancoAguzzi Hey great to see the progress here. Reviewed and shared feedback 👍

Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@FrancoAguzzi @notrab Thanks for updates. Reviewed and shared feedback 👍

packages/nameguard-sdk/tsconfig.json Outdated Show resolved Hide resolved
packages/nameguard-sdk/src/utils.test.ts Outdated Show resolved Hide resolved
packages/nameguard-sdk/src/utils.test.ts Outdated Show resolved Hide resolved
packages/nameguard-sdk/src/utils.test.ts Outdated Show resolved Hide resolved
packages/nameguard-sdk/src/index.ts Outdated Show resolved Hide resolved
packages/nameguard-sdk/src/index.test.ts Outdated Show resolved Hide resolved
packages/nameguard-react/src/components/Report/Report.tsx Outdated Show resolved Hide resolved
window.location.href = `https://nameguard.io/inspect/${encodeURIComponent(
ensName.name,
)}`;
const onClickHandler = (clickHandlerFor: ClickHandlerFor) => {
Copy link
Member

Choose a reason for hiding this comment

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

Note to self: If time allows I want to look at this closer.

window.location.href = `https://nameguard.io/inspect/${encodeURIComponent(
ensName.name,
)}`;
const onClickHandler = (clickHandlerFor: ClickHandlerFor) => {
Copy link
Member

Choose a reason for hiding this comment

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

Note to self: if time allows have a closer look at this.

packages/nameguard-sdk/src/utils.ts Outdated Show resolved Hide resolved
Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@FrancoAguzzi Nice updates! Reviewed and shared feedback 👍

packages/nameguard-react/src/utils/text.ts Outdated Show resolved Hide resolved
Copy link
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@FrancoAguzzi Thanks for updates. Reviewed and shared feedback

@@ -3,7 +3,10 @@ import { defineConfig } from "tsup";
export default defineConfig({
entry: ["src/index.ts"],
format: ["esm"],
splitting: true,
sourcemap: true,
minify: false,
Copy link
Member

Choose a reason for hiding this comment

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

Any changes to these tsup.config.js files either need to be reverted or discussed and aligned with @notrab. Thanks

Copy link
Member

Choose a reason for hiding this comment

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

@FrancoAguzzi Whenever you make any changes to any build configuration files, please proactively add a comment about that change inside the PR in GitHub that explains:

  1. Why that change was needed.
  2. The current status of getting approval from @notrab of the change.

onClickOverride,
onIconClickOverride,
onBadgeClickOverride,
onTooltipClickOverride,
Copy link
Member

Choose a reason for hiding this comment

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

@FrancoAguzzi I don't think we're going in the correct direction with this PR. We're not following our principles for composability.

  1. Let's please avoid ReportBadge becoming another "god" UI component with too many props. We need to design our UI components as needed so that they are composable.
  2. Why do we need all of these different "on click override" functions on each UI component? Why can't the code that wants to make use of ReportBadge just pass in some slots / props as needed? For example: There can be a slot for the icon in a ReportBadge. If someone wants the icon to have a special click override, they can pass special code into that slot as might be desired.
  3. I'm not sure we want so many degrees of freedom with so many customizations. It's best to keep it simple. Perhaps we remove some of these customizations entirely unless we see some real need for them right now.

onClickOverride?: (ensName: ENSName) => void;
type ReportShieldProps = {
onIconClickOverride?: (ensName: ENSName) => void;
onTooltipClickOverride?: (ensName: ENSName) => void;
Copy link
Member

Choose a reason for hiding this comment

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

Please see my other feedback about wanting to find a more composable and simplified solution that allows us to remove all these on click override callbacks.

@@ -17,11 +17,12 @@
],
"scripts": {
"build": "tsup",
"dev": "tsup --watch --clean=false"
"dev": "tsup --watch --clean=false",
"test": "vitest"
Copy link
Member

Choose a reason for hiding this comment

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

Can you help me understand the goal for adding the test script here and not running tests from the root directory of the repo? For example, is this different than what we're doing for other packages? If so, why?

I can understand that perhaps people who get our packages via NPM aren't getting the whole monorepo and therefore maybe this has a purpose to include in each package? But in my mind, when you get a package via NPM, it shouldn't be something you're running tests against. For example we shouldn't even include the test code in the files included in the NPM package distribution. The NPM package should just contain the "main" code and no tests. Right?

Assuming we should remove this vitest script here, then please also remove vitest as a devDependency

},
"exports": {
".": {
"types": "./dist/index.d.ts",
"types": "./dist/index.d.mts",
Copy link
Member

Choose a reason for hiding this comment

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

Can you please help to explain this change to .mts?

Copy link
Member

Choose a reason for hiding this comment

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

@FrancoAguzzi Whenever you make any changes to any build configuration files, please proactively add a comment about that change inside the PR in GitHub that explains:

  1. Why that change was needed.
  2. The current status of getting approval from @notrab of the change.

@@ -0,0 +1,3 @@

# dependencies
/node_modules
Copy link
Member

Choose a reason for hiding this comment

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

Why are we making this change? This suggests we aren't running our pnpm commands from the root of the monorepo. I don't see why we should do this?


type ShareProps = {
name?: string;
name: string;
Copy link
Member

Choose a reason for hiding this comment

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

We should make this an ENSName rather than a string.


type ShareProps = {
name?: string;
name: string;
};

function createTwitterLink(name: string) {
Copy link
Member

Choose a reason for hiding this comment

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

All of these functions should take an ENSName rather than a string.

@@ -137,12 +136,10 @@ export function Share({ name }: ShareProps) {

<div className="min-h-[200px] flex items-center justify-center px-6 md:px-10">
{name && (
Copy link
Member

Choose a reason for hiding this comment

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

Why are we checking here if name is defined? It should always be defined based on the defined props of this UI component.

* Fix PR 282

* Update sharing and report URL generation

* Many additional enhancements

* Misc small fixes

* Apply suggested update
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