Problem/Motivation

It takes a long time to run right now... figure out how to speed up.

Steps to reproduce

Proposed resolution

Perhaps not include storybook when building for xb-demo as it's not needed

Remaining tasks

Figure out improvement, change build rules, test, and commit

User interface changes

Faster when building :)

API changes

Data model changes

CommentFileSizeAuthor
#5 sdds-npm-run-dist-storybook.png57.31 KBkristen pol
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kristen pol created an issue. See original summary.

kristen pol’s picture

Try just using npm run dist instead of npm run build as that won't include storybook stuff

kristen pol’s picture

To test this, need to go through the normal build process here:

https://www.drupal.org/community-initiatives/starshot-demo-design-system...

but using npm run dist instead of npm run build

and see what happens on the settings page since that refers to storybook

kristen pol’s picture

Assigned: Unassigned » kristen pol

working on this

kristen pol’s picture

StatusFileSize
new57.31 KB

For starshot_demo directory:

npm run dist

  • real 0m21.462s
  • user 0m25.913s
  • sys 0m1.078s

npm run build

  • real 0m42.100s
  • user 1m17.437s
  • sys 0m3.981s

so saves almost a minute

and the theme handles the lack of storybook fine... settings end up looking like:

kristen pol’s picture

For the base theme:

npm run dist

  • real 0m21.954s
  • user 0m24.828s
  • sys 0m1.226s

npm run build

  • real 0m37.157s
  • user 0m46.011s
  • sys 0m3.326s

kristen pol credited heyyo.

kristen pol’s picture

Discussing with Lionel and the real performance improvement for xb-demo is to include all the built artifacts (dist directory) so that npm run dist (or build) doesn't need to be run at all.

The npm install process is slow too... probably because it's grabbing lots of dependencies for storybook (most of which go away in the latest civictheme version but we aren't using that yet).

kristen pol’s picture

This is what's in .gitignore:

.devtools
node_modules
storybook-static
dist
build
lib/uikit
components/**/*.css

so we probably would need to add more than just the dist directory, perhaps all of:

dist
build
lib/uikit
components/**/*.css


Another idea is that we create an xb-demo directory that has a copy of these and the xb-demo script, moves those copies into place during install rather than running npm install and npm run build

That way, the .gitignore remains the same and, if you are installing on your local with for development, then you just do the normal process. But, xb-dev has a quick way to get the built assets.

Maybe @phenaproxima has thoughts on this?

kristen pol’s picture

From @phenaproxima:

Ideally, you’d do what XB does, and just compile the assets and add them to release tags, and rm -rf them in a “back to dev” commit. Thoughts?

This is an interesting approach so we will probably do that :D

Just want to see if there's anything else that needs to be in a new release first.

kristen pol’s picture

kristen pol’s picture

Think we need these for base theme:

dist
components/**/*.css

and same for subtheme:

dist
components/**/*.css

but I'm not sure about these yet:

components_combined
.components-civictheme
phenaproxima’s picture

Maybe add them, if in doubt; they can always be removed in subsequent releases if they're not ultimately needed.

kristen pol’s picture

I've tested with just:

dist
components/**/*.css

added for both themes and it is working fine.

I'll merge and test again.

kristen pol’s picture

Merged... I'll test again before creating a release

kristen pol’s picture

Templates with XB are unhappy with the base theme so I'm going to get rid of those for now since we aren't using them

kristen pol’s picture

Assigned: kristen pol » Unassigned
Status: Active » Fixed
kristen pol’s picture

Status: Fixed » Closed (fixed)
kristen pol’s picture

Speed of

ddev composer create phenaproxima/xb-demo --stability=dev
real	3m22.094s
user	0m3.273s
sys	0m2.499s