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

Increase DX by providing pre-configured transformers #41

Closed
nvh95 opened this issue Apr 9, 2022 · 0 comments · Fixed by #47
Closed

Increase DX by providing pre-configured transformers #41

nvh95 opened this issue Apr 9, 2022 · 0 comments · Fixed by #47
Labels
documentation Improvements or additions to documentation enhancement Enhancement to current features/ behaviors feature request Request a new feature

Comments

@nvh95
Copy link
Owner

nvh95 commented Apr 9, 2022

What & Why

  • Currently, we are providing users process functions such as processFile, processFileCRA, processCss, then, they can implement the code transform by themselves. We gave users the flexibility to customize their own transformer.
  • However, most of the time, users don't want to deal with the complexity of configuring transformers by themselves. That's not a great DX looks like.
  • Applying the rule Don't make me think, we should provide them a just work/an opinioned solution. Then, integrating jest-preview will be very easy.

How

  • Build pre-configured transformers then bundle them when building. Then, users can use that without configuring by themselves (of course they can still customize it if they want by using exported process functions)
  • The code looks similar to this:
// jest.config.js
transform: {
  '^.+\\.css$': 'jest-preview/cssTransform.js',
  '^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)': 'jest-preview/fileTransform.js',
},
  • We might need to update the docs to encourage users to use pre-configured transformers instead of using process functions (< 0.2.0)

When

  • This is not a brand new feature. Just a wrapper for an existing one. So it's basically an improvement, does not introduce any breaking changes. So releasing it in a patch version is OK.
@nvh95 nvh95 added enhancement Enhancement to current features/ behaviors feature request Request a new feature documentation Improvements or additions to documentation labels Apr 9, 2022
@nvh95 nvh95 linked a pull request Apr 14, 2022 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement Enhancement to current features/ behaviors feature request Request a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant