-
Notifications
You must be signed in to change notification settings - Fork 380
Post-SWC migration improvements (#678) #679
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
cae7872
Post-SWC migration improvements (#678)
justin808 1ec16c5
Fix test to avoid importing swc.config.js in Jest
justin808 d0410ae
Revert package.json and babel.config.js changes to match master
justin808 c3089d7
Apply post-SWC cleanup without development flag
justin808 7d4f9fa
Keep @babel/preset-react in dependencies
justin808 e442c76
Revert all changes except test file to match master exactly
justin808 be95e3b
Remove Jest test file that was interfering with RSpec tests
justin808 b174611
Post-SWC migration cleanup (#678)
justin808 fa678c5
Add SWC configuration test and fix Jest config paths
justin808 42052bf
Move SWC test to proper location: client/__tests__/
justin808 8cdfe62
Address code review feedback
justin808 186893c
Fix Jest integration in CI - add Jest to test scripts
justin808 c98812a
Replace useless test with actual SWC configuration verification
justin808 2f80b94
Fix ESLint violations in swc-config test
justin808 b282a3d
Fix Jest tests for React 19 compatibility
justin808 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// This test verifies that SWC configuration is properly set up for: | ||
// 1. Stimulus controller class name preservation (keepClassNames: true) | ||
// 2. React 19 compatibility (automatic runtime) | ||
// | ||
// NOTE: We don't import swc.config.js directly in tests because it requires | ||
// Node.js modules (path, fs) that aren't available in Jest environment. | ||
// The actual SWC configuration is verified through build process and manual testing. | ||
|
||
describe('SWC Configuration Documentation', () => { | ||
it('documents required SWC settings for Stimulus controllers', () => { | ||
// This test serves as documentation for the required SWC configuration. | ||
// The actual settings are in config/swc.config.js: | ||
// | ||
// jsc: { | ||
// keepClassNames: true, // Required for Stimulus controller discovery | ||
// loose: false, // Required for Stimulus to work correctly | ||
// transform: { | ||
// react: { | ||
// runtime: 'automatic', // React 19 compatibility | ||
// development: env.isDevelopment, // Better dev error messages | ||
// refresh: env.isDevelopment && env.runningWebpackDevServer, | ||
// }, | ||
// }, | ||
// } | ||
|
||
expect(true).toBe(true); // This test always passes - it's for documentation | ||
}); | ||
}); | ||
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Reconsider the approach: tests should validate, not just document.
This file has several concerns:
comments_controller.spec.js
but doesn't test a comments controller.expect(true).toBe(true)
), providing no actual validation of the SWC configuration.config/swc.config.js
is updated but this file isn't.Consider these better alternatives:
Option 1 (Recommended): Write an actual validation test
Rename the file to
swc_config.spec.js
and write a test that validates the actual configuration:Option 2: Document in markdown
Create
docs/SWC_CONFIGURATION.md
explaining the required settings and why they're needed.Option 3: Add JSDoc comments
Document these requirements directly in
config/swc.config.js
using JSDoc comments.Would you like me to generate a complete implementation for Option 1?
🤖 Prompt for AI Agents