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

Remove whitespace in metadata.json #3034

Merged
merged 2 commits into from
Oct 11, 2024
Merged

Remove whitespace in metadata.json #3034

merged 2 commits into from
Oct 11, 2024

Conversation

alexcjohnson
Copy link
Collaborator

@alexcjohnson alexcjohnson commented Oct 11, 2024

Any reason we need metadata.json files to be human-readable? In some cases this is a large fraction of the total package size, eg snehilvj/dash-mantine-components#347 (cc @AnnMarieW)

optionals

  • I have added entry in the CHANGELOG.md

Copy link
Contributor

@T4rk1n T4rk1n left a comment

Choose a reason for hiding this comment

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

💃
The metadata.json is only kept as a relic of the past runtime component generator/loader.
I think the only reason to include it in the package is for tooling interactions, like if we had a layout editor it could use the data to list the components and have a named prop editor with the right types.

@alexcjohnson
Copy link
Collaborator Author

And perhaps for runtime typechecking of TS components, right?

@alexcjohnson alexcjohnson merged commit a354a73 into dev Oct 11, 2024
3 checks passed
@alexcjohnson alexcjohnson deleted the alex/shrink-metadata branch October 11, 2024 14:47
@T4rk1n
Copy link
Contributor

T4rk1n commented Oct 11, 2024

And perhaps for runtime typechecking of TS components, right?

No I think it should be generated in a .js file at generation time to have less overhead. The check is basically just window['componentlib'].component.propTypes(props, typeSpecName, componentName, ...) so the js file can set the propType for the components on the window.

@AnnMarieW
Copy link
Collaborator

So we should just delete the metadata.json file before deployment?

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