T2859 - "URL" JDD component argument type

thread init

Hello,
I’ve added new URL component to jdd project and new option to the playground, I also added unit tests in jdd, but, I have a few questions:

  1. how to verify if new option works in the playground if i have changes in jdd locally, and new option is not available yet.
  2. I have changes in two repos: jdd and playground. how to manage it in arcanist, I should create two diff?

One way to do that is to use npm link. It’s a command that lets you use code from your local repo almost as if it was installed from npm.

Go to jdd and run npm link. Then go to sealious-playground and run npm link @sealcode/jdd.

It might give you some Typescript errors… but only in typechecking phase. It’s a known issue and I don’t know a workaround. Thankfully it only gives you typechecking issues, but runtime should not be affected by this, so it should be enough to test on a “live” app

Yes, that would be the case :+1:

1 Like

diff from sealious for cr D1386
but this one,from jdd D1387 failed on linter apparently, however i confirmed linter fixes…

Try re-submitting the diff, that should clear those warnings :slight_smile:

1 Like

after ‘arc diff origin/master’

   Error  (ESLINT) @typescript-eslint/no-unnecessary-type-constraint
    Constraining the generic type `ARG` to `any` does nothing and is
    unnecessary.

              10 
              11 export type T = ExtractComponentArgumentValue<Structured<any>>;
              12 
    >>>       13 export abstract class ComponentArgument<ARG extends any> {
                                                         ^
              14 	public example_values: ARG[] = [];
              15 	abstract getTypeName(): string;
              16 	abstract getEmptyValue(): ARG;
 LINT ERRORS  Lint raised errors!
Running unit tests...
 Exception 
Failed to load symbol "DOMDocument" (of type "class or interface").

The class or interface "DOMDocument" is not defined in the library map of any loaded library.

If you are not a developer, this almost always means that a library is out of date. For example, you may have upgraded "phabricator/" without upgrading "arcanist/", or vice versa. It might also mean that you need to restart Apache or PHP-FPM. Make sure all libraries are up to date and all services have been restarted.

If you are a developer and this symbol was recently added or moved, your library map may need to be rebuilt. You can rebuild the map by running "arc liberate".

For more information, see: https://phurl.io/u/newclasses
(Run with `--trace` for a full exception trace.)

for this thing, you probably need to install the php-xml extension for your php version

For this - this is my bad. Please remove the extends any from line 13 and it should be good

done :slight_smile:

1 Like

Added some comments in D1386 :slight_smile:

here is a second diff from jdd source,I’m sorry, it looks i forgot to add you as reviever
https://hub.sealcode.org/D1387

1 Like

No worries, I see that Jenkins added the Reviewers group automatically - I’m part of this group, so I became automatically co-assigned :+1:

1 Like

access url test is failing, in seaalious playground

 src/back/routes/todo.test.ts (3) 36484ms
   ✓ Todo webhint (1) 566ms
   ❯ Todo (2) 26492ms
     ✓ todo test (1) 8833ms
     ❯ can access test (1) 17659ms
       × access url 17659ms
         ⠸ [ beforeEach ]
 ✓ src/back/collections/password-reset-intents.test.ts (4) 2697ms
 ✓ src/back/collections/user-roles.test.ts (5) 17779ms
 ❯ src/back/routes/logout.test.ts (2) 41158ms
   ✓ Logout (2) 30837ms
   ⠦ [ afterAll ]
 ❯ src/back/routes/hello.test.ts (1)
describe("can access test", () => {
		it(
			"access url",
			async function () {
				await withProdApp(async ({ base_url }) => {
					await page.goto(base_url);
					try {
						await page.waitForSelector(`a[href="${SignInURL}"]`);
						await page.goto(base_url + TodoURL);
						await page.waitForSelector('body:has-text("no access")');
					} catch (error) {
						console.error(error);
					}
				});
			},
			LONG_TEST_TIMEOUT
		);
	});

well turned out the port 8080 was in some unfinished process, reboot fixed issue. here is an diff Login

Does it fail for you after making some changes, or just when ran from the default branch?

Running npm run test should open a browser UI where it shows you the output of that command, can you show what’s the console output for the failing test?

T2859 - "URL" JDD component argument type - #14 by ziomek I wrote here tests passsed after rebbooting linnux. sometimes i can not run app because of ‘port iss already in use’ then i have to restart all the system

If the “port is already in use” appears again, try running killall tmux and see if that helps

1 Like

Login “There’s no need for a URL component. The URL ComponentArgument is going to be used as part of larger, separate components,” - which components?

so it shouldn’t be exportet here?

export const ComponentArguments = {
	Image,
	Structured,
	List,
	Markdown: MarkdownArgument,
	ShortText,
	Enum,
	URL,
};

Any components that will display configurable links - it’s gonna come in handy for navbars, contact pages, etc

The URL ComponentArgument should be exported - otherwise we won’t be able to use it in, say, SealiousPlayground to build a component

fixed D1387