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

Emit events on lr-upload-ctx-provider block #553

Merged
merged 2 commits into from
Nov 9, 2023
Merged

Conversation

nd0ut
Copy link
Member

@nd0ut nd0ut commented Nov 1, 2023

Description

Checklist

@nd0ut nd0ut marked this pull request as draft November 1, 2023 13:39
@nd0ut nd0ut changed the title WIP Emit events on lr-upload-ctx-provider block Nov 1, 2023
@nd0ut nd0ut force-pushed the feat/events-on-ctx-block branch from 2d5a6c4 to eb77a36 Compare November 3, 2023 13:16
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

CodeQL found more than 10 potential problems in the proposed changes. Check the Files changed tab for more details.

@nd0ut nd0ut force-pushed the feat/events-on-ctx-block branch from eb77a36 to 912ed77 Compare November 7, 2023 08:26

const ctx: UploadCtxProvider = null as unknown as UploadCtxProvider;

ctx.addEventListener('data-output', (e) => {

Check failure

Code scanning / CodeQL

Property access on null or undefined

The base expression of this property access is always null.
() => <lr-config ctx-name="1" key={1}></lr-config>;

// allow useRef hook
() => {

Check warning

Code scanning / CodeQL

Expression has no effect

This expression has no effect.
};

// allow callback ref
() => {

Check warning

Code scanning / CodeQL

Expression has no effect

This expression has no effect.
};

// allow createRef
() => {

Check warning

Code scanning / CodeQL

Expression has no effect

This expression has no effect.
};

// accept config attributes
() => <lr-config ctx-name="1" multiple multipleMax={1} multipleMin={2} accept="str" />;

Check warning

Code scanning / CodeQL

Expression has no effect

This expression has no effect.
() => <lr-config ctx-name="1" multiple multipleMax={1} multipleMin={2} accept="str" />;

// allow to use DOM properties
() => {

Check warning

Code scanning / CodeQL

Expression has no effect

This expression has no effect.


// allow to pass metadata
() => {

Check warning

Code scanning / CodeQL

Expression has no effect

This expression has no effect.
const ref = React.useRef<Config | null>(null);
if (ref.current) {
const config = ref.current;
config.metadata = {foo: 'bar'}

Check warning

Code scanning / CodeQL

Useless assignment to property

This write to property 'metadata' is useless, since [another property write](1) always overrides it.
if (ref.current) {
const config = ref.current;
config.metadata = {foo: 'bar'}
config.metadata = () => ({foo: 'bar'})

Check warning

Code scanning / CodeQL

Useless assignment to property

This write to property 'metadata' is useless, since [another property write](1) always overrides it.
import { OutputFileEntry } from '..';

// @ts-expect-error untyped props
() => <lr-config ctx-name="1" something="wrong"></lr-config>;

Check warning

Code scanning / CodeQL

Expression has no effect

This expression has no effect.
@nd0ut nd0ut marked this pull request as ready for review November 7, 2023 08:59
@nd0ut nd0ut force-pushed the feat/events-on-ctx-block branch from a089d76 to b30cee5 Compare November 7, 2023 09:18
@nd0ut nd0ut force-pushed the feat/events-on-ctx-block branch from 3df68db to 2c65b7d Compare November 7, 2023 09:39
@loookashow loookashow self-requested a review November 8, 2023 09:04
@nd0ut nd0ut merged commit 2beae73 into main Nov 9, 2023
1 check passed
@nd0ut nd0ut deleted the feat/events-on-ctx-block branch November 9, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants