docs(RFC): Update File Organization Convention for v9 RFC to address other issue#24543
Conversation
📊 Bundle size report🤖 This report was generated against adea89e6cc51161fbb544f465e298f60046fd55c |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 8378977:
|
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: adea89e6cc51161fbb544f465e298f60046fd55c (build) |
| |- {ComponentName}.tsx | ||
| |- {ComponentName}.types.ts | ||
| |- {ComponentName}.test.tsx | ||
| |- {ComponentName}.e2e.tsx |
There was a problem hiding this comment.
thought: i have mixed feelings about this. while I understand the reasoning because we have all the context, it might feel missleading to OSS contributors what e2e actually means.
Nx uses cy suffix, which explicitly express the intent {ComponentName}.cy.tsx (cypress component testing)
One downside of this is if we gonna switch to something else in the future, we would need to change the suffix ( lets say we switch to playwright ).
WDYT?
There was a problem hiding this comment.
I'm in favor of being more explicit and using .cy. - if we have to switch to another solution in the future, then it should be updated accordingly.
| |- index.ts | ||
| |- shared-component-types.types.ts | ||
| |- some-function-or-hook.ts | ||
| |- testing/ |
There was a problem hiding this comment.
maybe utils-testing ? to mirror the utils approach ?
| We're already following this convention when it comes to e2e so most of the work will be extracting stories out of the `src` folder and moving those to the root of the package. The asset files will also need to be moved to the appropriate `assets` subfolder. And finally, the `.npmignore` file will then be updated to ignore any asset files and files living within the documentation folder. | ||
| We will be extracting stories out of the `src` folder and moving those to the root of the package within a `stories/` subfolder. The asset files will also need to be moved to the appropriate `assets` subfolder. The `.npmignore` file will then be updated to ignore any asset files and files living within the documentation folder. | ||
|
|
||
| Also, the old `common/` folder which caused confusion and unexpected linting errors will now be replaced with a more robust `testing/` subfolder within the `src` folder to house the conformance testing factory and any mock or utility testing files to be used in multiple tests within a package. |
rfcs/shared/build-system/07-standard-package-structure-for-v9.md
Outdated
Show resolved
Hide resolved
Hotell
left a comment
There was a problem hiding this comment.
some thoughts and suggestions. lets keep the convo going. otherwise LGTM
Changes
common/folder and adds proposed replacement for it. Also provides a more detailed outline of how thecomponents/,utils/and newtesting/subfolders should be structured.e2e/subfolder in favor of collocating cypress tests with the implementation and unit/jest files.PREVIEW
Follow-up to #24332 (comment)
Part of #24129