Twitter | Търсене | |
Dan Abramov
Working on . Co-author of Redux and Create React App. Building tools for humans.
51 265
Туитове
824
Следван/а
132 731
Последователи
Туитове
Dan Abramov 27 с
Отговор до @fbartho
It is a guideline though. It means literally “start by putting everything in one file; when it feels like it’s annoying, start splitting them up; what THAT gets annoying, maybe add some folders”.
Reply Retweet Харесване
Dan Abramov 1 мин
Отговор до @acordova
I don’t disagree! When you have a good idea of *why* you adopt a certain file structure it can be a real blessing. People who feel this way have usually already chosen one though. It’s beginners who are confused because they feel they *must* abide by certain rules.
Reply Retweet Харесване
Dan Abramov 3 мин
Отговор до @acordova
CRA doesn’t structure your app at all beyond dividing it in two folders: one for source, and one for other assets. That’s as minimal as possible without adding configuration. What you do in those folders is completely up to you.
Reply Retweet Харесване
Dan Abramov ретуитна
pia mancini 27 мин
I just published “Introducing BackYourStack.”
Reply Retweet Харесване
Dan Abramov 12 мин
Okay, I give in. I wrote a guide on the most scalable file structure for React projects. I’m using it every day. Best part: it works for Vue projects too. Hope it’s helpful! ✨
Reply Retweet Харесване
Dan Abramov 31 мин
Отговор до @rauschma
The paradox is that people crave “React file structure“ most of all while React specifically doesn’t give you any limitations
Reply Retweet Харесване
Dan Abramov ретуитна
Ryan Florence 1.08
Woah, next.js + mdx + react-live is gonna make for the best documentation creation and consumption experience I think I've ever seen. Example on the left, markdown file that becomes the page on the right, code is displayed, renders, and *is editable* in the browser!
Reply Retweet Харесване
Dan Abramov 34 мин
Отговор до @LagierGear
People are asking for it when it’s *not* enforced though. They’re given full freedom and ask for guidance. I wonder if it’s better to offer superficial advice (which doesn’t actually matter) or to teach that it doesn’t matter
Reply Retweet Харесване
Dan Abramov 35 мин
Отговор до @_SeanGroff
Let’s call it “dropbox file structure”
Reply Retweet Харесване
Dan Abramov ретуитна
Dan Abramov 38 мин
Отговор до @_SeanGroff
I don’t have an answer. This topic is confusing me. My preferred file structure is “create a new folder when it feels like it’s hard to find a file in a pile of other files” and “combine folders when it feels like there’s too many of them and it’s hard to navigate them”.
Reply Retweet Харесване
Dan Abramov 38 мин
Отговор до @_SeanGroff
I don’t have an answer. This topic is confusing me. My preferred file structure is “create a new folder when it feels like it’s hard to find a file in a pile of other files” and “combine folders when it feels like there’s too many of them and it’s hard to navigate them”.
Reply Retweet Харесване
Dan Abramov 41 мин
Отговор до @dan_abramov
Next time you write about the file structure you’re using, think before calling your article “React file structure“ or “Vue file structure”. How you organize your files has nothing to do with what renders rectangles on your screen. It’s “JavaScript project file structure”!
Reply Retweet Харесване
Dan Abramov 42 мин
Maybe they have troubles with this because we’re teaching them that different libraries have different “file structures”. Maybe it’s a misleading thing to teach, and it would be better to approach it from a more generic angle.
Reply Retweet Харесване
Dan Abramov 43 мин
I finally understood why questions about file structure of React projects confuse me. It’s because any answers aren’t React-specific. Is it time to start saying “JavaScript front-end file structure” instead of “library X file structure”?
Reply Retweet Харесване
Dan Abramov 45 мин
What *would* make sense to me is a generic discussion, e.g. “how do you organize files in a JavaScript front-end project”. I don’t understand what’s the point of “React file structure” or “Vue file structure” and why they would be any different.
Reply Retweet Харесване
Dan Abramov 46 мин
I’m supportive of publishing a recommendation if people feel strongly about it. But it’s perplexing to me why a *library* needs to recommend how you structure your folders on the disk, and why people feel like the recommendation has to come from a *specific* lib they’re using.
Reply Retweet Харесване
Dan Abramov 48 мин
Neither React nor Vue have any special opinions about files. They’re not tied to filesystem in any way. From this follows that any file structure that works great with Vue would also work great with React.
Reply Retweet Харесване
Dan Abramov 48 мин
What I’m saying is that all of these libraries are component-oriented. Whether React docs say something or not, I don’t understand why you couldn’t teach the same file structure that worked for you with Angular or Vue, to React users 🙂
Reply Retweet Харесване
Dan Abramov 58 мин
If you’ve seen a successful project structure in Angular/Vue, why would a React one be different?
Reply Retweet Харесване
Dan Abramov ретуитна
Tyler McGinnis 7.08
👋 Tonight is day 1 of the free, online React Native Bootcamp by He'll be covering - What is React Native? - Why use React Native? - Pros and Cons of React Native - Your first React Native App - React in the React Native Environment
Reply Retweet Харесване