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

feat: pass parser options to allow parsing of tsx files #25145

Merged

Conversation

astone123
Copy link
Contributor

NOTE: All of our cypress-in-cypress tests will fail on this branch because of an issue with the way that Babel dependencies are being resolved in the v8 snapshot. This is currently being investigated. I'm going to merge this into the feature branch anyway once I get approvals and I see that CodegenActions.spec.ts has passed in CI.

User facing changelog

n/a, merging to feature branch

Additional details

Our current implementation of create from React component will fail to parse TSX files that contain type annotations. This PR adds some parser plugins to allow for the parsing of TSX files.

Steps to test

  1. Check out this branch
  2. Revert the change to CodegenActions.ts
  3. Run env DEBUG="cypress:data-context" yarn workspace @packages/data-context test
  4. Notice that the correctly parses typescript files test case fails
  5. See the debug error in the console indicating a syntax error occurred while parsing the file
  6. Re-introduce the changes to CodegenActions.ts
  7. Run the tests again and verify that they all pass and that LoginForm.tsx was parsed correctly

How has the user experience changed?

n/a

PR Tasks

  • Have tests been added/updated?
  • [na] Has the original issue (or this PR, if no issue exists) been tagged with a release in ZenHub? (user-facing changes only)
  • [na] Has a PR for user-facing changes been opened in cypress-documentation?
  • [na] Have API changes been updated in the type definitions?

@astone123 astone123 self-assigned this Dec 14, 2022
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Dec 14, 2022

Thanks for taking the time to open a PR!

@cypress
Copy link

cypress bot commented Dec 14, 2022



Test summary

24391 67 2461 629Flakiness 18


Run details

Project cypress
Status Failed
Commit bcf9822
Started Dec 14, 2022 9:08 PM
Ended Dec 14, 2022 9:24 PM
Duration 16:00 💡
OS Linux Debian -
Browser Multiple

View run in Cypress Dashboard ➡️


Failures

Run group: app-e2e (Linux, Chrome )
runner/reporter-ct-webpack.errors.cy.ts Failed
1 Webpack - errors ui > assertion failures
runner/ct-framework-errors.cy.ts Failed
1 React 17 > error conditions
runner/reporter-ct-vite.errors.cy.ts Failed
1 Vite - errors ui > assertion failures
runner/reporter-ct-mount-hover.cy.ts Failed
1 CT Mount angular-14 > While hovering on Mount(), shows component on AUT for angular-14
specs.cy.ts Failed
1 ... > shows create first spec page with scaffold and create empty spec options
runs.cy.ts Failed
1 App: Runs > Runs Page > resolves the runs page
runner/reporter.command_errors.cy.ts Failed
1 errors ui > assertion failures
runner/sessions.ui.cy.ts Failed
1 runner/cypress sessions.ui.spec > creates new session
runner/retries.ui.cy.ts Failed
1 runner/cypress retries.ui.spec > collapses tests that retry and pass
This comment includes only the first 10 test failures. See all 43 failures in the Cypress Dashboard.
Run group: 5x-driver-chrome (Linux, Chrome )
Run group: launchpad-e2e (Linux, Chrome )
top-nav-launchpad.cy.ts Failed
1 ... > with no project id > shows "continue" button after login if config has not loaded
This comment includes only the first 10 test failures. See all 12 failures in the Cypress Dashboard.
Run group: app-ct (Linux, Chrome )
Run group: webpack-dev-server (Linux, Chrome )
Run group: vite-dev-server (Linux, Chrome )

Flakiness

cypress/e2e/e2e/origin/cookie_behavior.cy.ts Flakiness
1 ... > same site / cross origin > XMLHttpRequest > sets cookie on same-site request if withCredentials is true, and attaches to same-site request if withCredentials is true
2 ... > same site / cross origin > fetch > sets same-site cookies if "include" credentials option is specified from request, but does not attach same-site cookies to request by default (same-origin)
3 ... > same site / cross origin > XMLHttpRequest > sets cookie on same-site request if withCredentials is true, and attaches to same-site request if withCredentials is true
4 ... > same site / cross origin > fetch > sets same-site cookies if "include" credentials option is specified from request, but does not attach same-site cookies to request by default (same-origin)
5 ... > same site / cross origin > XMLHttpRequest > sets cookie on same-site request if withCredentials is true, and attaches to same-site request if withCredentials is true
This comment includes only the first 5 flaky tests. See all 18 flaky tests in the Cypress Dashboard.

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

Copy link
Contributor

@ZachJW34 ZachJW34 left a comment

Choose a reason for hiding this comment

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

Glad we have a fix!

…ess-io/cypress into astone123/docgen-parser-opts
Copy link
Contributor

@lmiller1990 lmiller1990 left a comment

Choose a reason for hiding this comment

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

Just one change from Zach W and we can merge, nice job 👍

@astone123 astone123 merged commit 30a5a31 into feature/create-from-react-component Dec 14, 2022
@astone123 astone123 deleted the astone123/docgen-parser-opts branch December 14, 2022 20:55
lmiller1990 added a commit that referenced this pull request Dec 19, 2022
* feat: server logic for create from React component (#24881)

Co-authored-by: Ryan Manuel <[email protected]>
Co-authored-by: Lachlan Miller <[email protected]>

* fix: add default export detection (#24954)

Co-authored-by: astone123 <[email protected]>

* update cache

* update yarn.lock to fix builds

* fix: compilation with webpack preprocessor

* feat: create from React component UI (#24982)

* feat: WIP server logic for create from React component

* feat: add more tests; error handling

* feat: WIP create from React UI

* feat: PR feedback [run CI]

* feat: try committing snapshot cache changes [run ci]

* feat: try re-generating snapshot [run ci]

* fix build

* regenerate cache on darwin

* update caches

* Revert "feat: try re-generating snapshot [run ci]"

This reverts commit d763e1f.

* fix typing error

* types

* fix test

* chore: try using [email protected]

* update test

* regen linux snapshot

* update snapshots for darwin

* re-gen linux snapshot

* yarn install

* update snapshots

* update snapshot metadata

* update snapshots due to babel deps changing slightly

* make react docgen a dep

* update tests

* revert

* snapshots again??

* revert

* update

* update

* try change snapshot

* change snap

* update snap

* feat: remove unnecessary ts-ignore

* feat: add more test cases

* feat: create CodegenActions; other minor refactors

* feat: continue UI work

* feat: ignore config and Cypress-related files

* feat: PR feedback

* update Vue component link

* merge in default export work

* consolidate graphql queries

* other misc feedback

* use network-only policy to fetch files; include cypress/ dir for code gen candidates; fix type error

* add basic e2e test

* fix app integration tests

* refactor and fix app component and webpack dev server tests

* add error state; fix unit tests [skip ci]

* simplify generator show logic [skip ci]

* more testing

* fix types

* style updates [skip ci]

* fix error state [skip ci]

* fix list padding [skip ci]

* use slots (#25079)

* add more tests; fix unit tests

* fix types

* fix test describe

* add percy snapshots for new list

* update trouble rendering banner link [skip ci]

* use collapsible component

* use button for component list items

* fix tests

* build binaries

* revert changes to circle config

* remove eslintignore and extra loading div [skip ci] because we know it will fail

* revert changes to framework glob patterns [skip ci]

Co-authored-by: Ryan Manuel <[email protected]>
Co-authored-by: Lachlan Miller <[email protected]>

* feat: pass parser options to allow parsing of tsx files (#25145)

* fix create from component e2e test

* build binaries [run ci]

* fix component tests [run ci]

* regen windows snapshot

Co-authored-by: Ryan Manuel <[email protected]>
Co-authored-by: Lachlan Miller <[email protected]>
Co-authored-by: Zachary Williams <[email protected]>
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