forked from reg-viz/storycap
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Sync updates from storycap upstream #7
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…lnerability fix(deps): update dependency minimatch to v3.0.5 [security]
Record CPU traces from screenshot runs
- Rerender story after the cleanup events have been fired - Remove workaround from reg-viz#712
…ndElement reg-viz#806 Fix "failed to find element"
throwandgo
force-pushed
the
austin-david/sync
branch
2 times, most recently
from
October 4, 2023 15:27
42a6db2
to
871187c
Compare
Storybook v7+ uses Webpack 5, which follows a different module resolution strategy than Webpack 4. This is mostly irrelevant for this fork of reg-viz/storycap, but it proves to be problematic in test. The package generated from this fork goes by the name '@remix/storycap' instead of 'storycap', and we made edits to the root `package.json` file to reflect the name difference. Among other things, the test harness for 'storycap' copies the root package.json and the package's compiled JS into the `node_modules` subdirectories under `examples/*`, simulating the installation of 'storycap' via npm/yarn. Each 'storybook' version (v5, v6, and v7) has at least one set of examples so that 'storycap' can be tested against each one. For 'storybook' v5 and v6, the tests pass successfully. However, for 'storybook' v7, the use of Webpack 5 and its module resolution strategy causes module lookup issues for 'storycap'; the 'storycap' directory can be found under `node_modules`, but the custom package name ('@remix/storycap') causes the module lookup to ultimately fail. For consistency, this commit simulates the installation of a '@remix/storycap' package instead of a 'storycap' package, since this is what we'd like to test anyways. Now, the name of the directory under `node_modules` matches the declared package name in `package.json`. We don't want to tinker with the test setup too much further, so instead of replacing all references to 'storycap' with '@remix/storycap', we instead update the Storybook Webpack config to alias 'storycap' to '@remix/storycap', which works in all places but one. This solution isn't ideal, but it prevents us from drifting further from upstream, which is nice. At current date, there's only a 2 line diff that forces us to keep this fork: exposing `setViewport` so that the viewport can be set dynamically before the test is run. In the future, we would love to get this change merged into upstream. In the meantime, we try to keep the set of changes to this fork as minimal as possible to make the eventual cleanup straightforward.
throwandgo
force-pushed
the
austin-david/sync
branch
from
October 4, 2023 16:07
871187c
to
ecf696b
Compare
The previous commit updates the test harness to simulate the installation of a '@remix/storycap' package instead of a 'storycap' package, which requires us to introduce a Webpack alias so all of the Storybook code points to our custom package. This is difficult to do in Storybook v5, which structures its configuration files differently (at least, before v5.3). Rather than spending time trying to figure out how to make this work, we opt to skip the tests for Storybook v5, since we're already on Storybook v6 in the Remix monorepo anyways. See: https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#from-version-52x-to-53x.
throwandgo
force-pushed
the
austin-david/sync
branch
from
October 4, 2023 17:09
880e37d
to
b8ba72a
Compare
davidmh
approved these changes
Oct 4, 2023
Got Jamie's approval offline! |
if (prjDir === dist) { | ||
console.error(`target dir shold not be "${prjDir}".`); | ||
console.error(`target dir should not be "${prjDir}".`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull in new changes from reg-viz/storycap, including the ability to shard screenshot captures across machines. We anticipate using this feature to ease the burden placed on individual CircleCI instances, since screenshot captures can be resource- and time-intensive.
Resolved conflicts on:
Since we last synced from upstream, the following changes have been accepted:
We continue to maintain this fork because we're waiting for this issue to be addressed:
This sync is reflected in a version bump of our fork from 1.0.4 to 1.1.0.