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

Add Component CSS imports to state #402

Merged
merged 49 commits into from
Oct 11, 2023

Conversation

alextaing
Copy link
Contributor

@alextaing alextaing commented Oct 10, 2023

This PR adds a list in ComponentMetadata of the file paths to the CSS files that each component imports. In ComponentFile, a dependency tree is used to find all transitive CSS for each component. The dependency-tree library allows for optimization by passing in already parsed dependency trees, so component tree is formed in Parsing Orchestrator so that previous dependencies can be accessed.

J=SLAP-2912
TEST=auto,manual

alextaing and others added 11 commits October 10, 2023 14:58
This PR adds an Info icon to the right of the Prop Name when the Prop has a Tooltip. The anchor of the Tooltip is now the Info Icon. To do this, I created a new common Component called TooltipIcon representing the combination of an `Icon` and a `Tooltip`. I added visual regression coverage for Prop Tooltips as well, we were missing it.

J=SLAP-2952
TEST=auto
This PR adds an Info icon to the right of the Prop Name when the Prop has a Tooltip. The anchor of the Tooltip is now the Info Icon. To do this, I created a new common Component called TooltipIcon representing the combination of an `Icon` and a `Tooltip`. I added visual regression coverage for Prop Tooltips as well, we were missing it.

J=SLAP-2952
TEST=auto
alextaing and others added 11 commits October 11, 2023 12:30
In Vite, your project's dependencies are pre-bundled before the Dev
server loads your site. As an optimization, Vite allows these bundled
dependencies to be cached. If a dependency hasn't changed, Vite does not
need to pre-bundle it again. See details here:
https://vitejs.dev/guide/dep-pre-bundling.html#caching. Unfortunately,
this caching behavior is causing significant problems in Storm
(https://yext.slack.com/archives/C03F59PCJRK/p1696964495301699).

In this PR, I remove the cache optimization from Studio's Vite instance.
This is done by running Vite with `--force`. Although it wasn't strictly
necessary, I also removed `optimizeDeps` from the Vite Config.
Dependencies will always be pre-bundled whenever Studio starts up.
Removing this optimization, I did not notice a big drop in performance
locally.

J=SLAP-2961
TEST=manual

I ran this new version of Studio against the Test Site. I verified none
of the cached dependencies were used and that Studio started up as
expected.

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
## Features
- When specifying a Component's Prop Interface, you can now use the
`extends` keyword. (#395)

## Changes
- Cached, pre-bundled dependencies are now ignored when starting Studio.
Studio's Vite instance will pre-bundle all dependencies each time Studio
is started. (#405)
- Props with a Tooltip now have an Info Icon (#403)

## Fixes
- Incorrect imports for commonly-named Components have been fixed.
(#398)
## Fixes
- Do not try and cache Studio's Virtual modules. (#406)
Copy link
Contributor

@nmanu1 nmanu1 left a comment

Choose a reason for hiding this comment

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

🔥

@alextaing alextaing merged commit 040797b into feature/css-in-iframe Oct 11, 2023
15 checks passed
@alextaing alextaing deleted the dev/component-css-imports branch October 11, 2023 19:33
alextaing added a commit that referenced this pull request Oct 17, 2023
This PR adds a list in `ComponentMetadata` of the file paths to the CSS
files that each component imports. In `ComponentFile`, a dependency tree
is used to find all transitive CSS for each component. The
`dependency-tree` library allows for optimization by passing in already
parsed dependency trees, so component tree is formed in Parsing
Orchestrator so that previous dependencies can be accessed.

J=SLAP-2912
TEST=auto,manual
alextaing added a commit that referenced this pull request Oct 17, 2023
This PR adds a list in `ComponentMetadata` of the file paths to the CSS
files that each component imports. In `ComponentFile`, a dependency tree
is used to find all transitive CSS for each component. The
`dependency-tree` library allows for optimization by passing in already
parsed dependency trees, so component tree is formed in Parsing
Orchestrator so that previous dependencies can be accessed.

J=SLAP-2912
TEST=auto,manual
alextaing added a commit that referenced this pull request Oct 17, 2023
This PR adds a list in `ComponentMetadata` of the file paths to the CSS
files that each component imports. In `ComponentFile`, a dependency tree
is used to find all transitive CSS for each component. The
`dependency-tree` library allows for optimization by passing in already
parsed dependency trees, so component tree is formed in Parsing
Orchestrator so that previous dependencies can be accessed.

J=SLAP-2912
TEST=auto,manual
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