Comments (5)
That's awesome @justincy! Is there any way to decouple it, so that a user could install preset-typescript
(possibly updated by you) and preset-css-modules
(doesn't exist yet, you'd contribute it) and achieve the same result? Or could it not work that way?
from presets.
I'm not an expert in this area, but as far as I can tell, the existing preset-typescript
is not compatible with Next. Next actually provides its own babel preset which is the easiest way to get TypeScript working for Next (it's included in the Storybook preset here). I think the issue with preset-typescript
has to do with how Next doesn't require React to be imported in files that use JSX. For now I could create preset-next-typescript
until someone with more expertise figures out whether there's a way to merge it into preset-typescript
.
I see the benefit of creating the preset-css-modules
. I guess there's no reason it needs to be coupled with preset-next-typescript
.
from presets.
As far as not including preset-css-modules
with the preset-next-typescript
goes, Next 9.2 allows for css modules to be imported within the _app.(jsx|tsx)
out-of-box. I think a seperate package for preset-css-modules
would be nice for people with other applications, but having that preset as well included by default in any Next preset (typescript or javascript) might mitigate some headaches. That way the most manual work after installing a Next preset would be importing your global css files to something like the preview.js
file in your gist.
Additionally, the _app.(jsx|tsx)
file will always be in the same spot in a Next project's file hierarchy so maybe there is a small script that could scan for import statements ending with .css
too?
from presets.
We have a specific preset for CRA that basically tries to reuse a users CRA settings to match their app setup as closely as possible, no matter the config (js, ts, etc). Iām wondering whether the same thing might be possible for Next? Cc @mrmckeb
from presets.
So I was thinking about Next and Gatsby recently.
The problem is that both have plugin architectures, so we'd have to think about how we support those too - this is particularly important with Gatsby - which has a large plugin ecosystem.
That being said, I think we could support the 'defaults' with presets. We could also reach out to the maintainers and see if they'd be interested in supporting the presets - as ultimately that is a goal of presets I think (@shilman).
from presets.
Related Issues (20)
- [Bug] CRA does not print eslint errors to terminal anylonger
- [Bug] CRA preset does not support ES2020 dependencies HOT 2
- Where are the tests for your presets?
- V3.2.0 works but V4.0.0 does not HOT 4
- [Bug] preset-create-react-app: Storybook config dir webpack override breaks default CRA config
- [Bug] Install @storybook/preset-scss with default storybook's bundler 'webpack4' doesn't works HOT 5
- [Bug] CRA5, [email protected] HOT 6
- [Bug] Fails in case of using custom folder structure inside /src
- [Help] Cannot find module '@babel/plugin-proposal-private-property-in-object'
- @storybook/preset-create-react-app 4.0.1 breaks Storybook HOT 4
- [Bug]: macos - Error: Cannot find module '.../node_modules/config/webpack.config' HOT 5
- [Bug] URL from readme does not exist on the website
- [Bug] ENAMETOOLONG on "preset-create-react-app@4" package installation HOT 1
- [Bug] start-storybook breaks when tsconfig.json has comments (preset-create-react-app)
- [Bug] Package dependency HOT 4
- [Bug] Confusing error message when stories folder is outside of src.
- [Bug] cannot run storybook with CRA preset version 4.1.0. HOT 1
- @storybook/react-docgen-typescript-plugin canary dependency
- [Bug] Storybook preset function `getReactScriptsPath` has bug HOT 2
- Missing license file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
š Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ššš
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ā¤ļø Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from presets.