question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is the 'remove-demo' script maybe a little over-zealous?

See original GitHub issue

Okay, so I admit up-front: yes, user error. I should have been more careful. But I just found out the hard that the ‘remove-demo’ script removes more or less everything. I left the demo files in while I started working so that I could have a reference as to how things are wired up and such. After getting my head around it, I ran the script only to find that it deleted pretty much everything.

FWIW, this is not a “real” project I’m working on–mostly just trying to get my head around Slingshot, so it’s not like it’s a huge deal for me or anything. But looking at the script, this part seems like it might be a little overkill, as it seems to assume that the user has not already added any of their files to any of these directories:

const pathsToRemove = [
  './src/actions/*',
  './src/businessLogic',
  './src/components/*',
  './src/constants/*',
  './src/containers/*',
  './src/images',
  './src/reducers/*',
  './src/store/store.spec.js',
  './src/styles',
  './src/routes.js',
  './src/index.js'
];

I’m wondering if it should either be updated to list the specific files that need to be deleted, or maybe even just add a note in the pertinent FAQ section warning users about how thorough this is? I would hate to someone lose “real” work because they were stupid enough to do what I did. 😃

I also wonder if index.js needs to be listed at all, since it is really already pretty generic and universal as it is?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:25 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
raythreecommented, Feb 27, 2017

@mikedevita, I agree that it sucks to have to rewire the index, store, reducers, etc. to get a working starter. I know how all this stuff works, but sometimes I’m working on backend server-side stuff and can go weeks or months not doing UI work. So it’s a pain to need to remember how to wire everything up!

Slingshot is awesome, well maintained, and carefully thought out. So I want to simply clone the latest version and start using it for each new project. Before I was cloning it and making modifications to fit my structure. I’ve been away for a while and found that a good deal had changed, including using Jest instead of Mocha.

@kwelch, I think the solution is to leave the remove-demo script exactly as it is. People can create their own starter apps that are structured exactly the way they want, and then drop that in after removing the demo. This is exactly what I did here:

https://github.com/raythree/slingshot-hello

So now I can grap the latest react-slingshot, with all the up-to-date enancements, and drop in my own app structure that I can turn into the start of a production app in under a minute, with minimum edits.

1reaction
raythreecommented, Feb 28, 2017

@kwelsch if you take a look at the src folder of the repo I listed above you will see pretty much the exact minimum number of files that you need to create after remove-demo, to get a fully functioning app (with routes, a store, and functioning sync and async actions). The only file there that already existed was src/store/configureStore.

Leaving configureStore was a good choice, because it does a lot of configuration for dev and production environments, and all you really need to do with it is add any middleware that you choose.

Everything else is pretty much application specific. While the ideal goal would be to have 1 component, 1 container, and 1 test case ready to go like the starter that I’m using, there is no scheme that will satisfy everyone. For example, I prefer a functional layout to the layout by type because I find it scales better for larger apps. I also like the tests in a separate (mirrored) directory.

So, I think as it stands “remove-demo” is perfect.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overzealous Definition & Meaning - Merriam-Webster
The meaning of OVERZEALOUS is too zealous : having or showing too much zeal : excessively eager, enthusiastic, or fervent.
Read more >
Nicolas Leydet's Instagram, Twitter & Facebook on IDCrawl
Is the 'remove-demo' script maybe a little over-zealous? ... Learning Python: Learn to code like a professional with Python ... ... Trophée Jean...
Read more >
What is the review of PS1 movie? - Quora
No, but if you enjoy the nostalgia then go for it. I almost always regret purchasing older games for the sake of nostalgia...
Read more >
Untitled
add s390x to 64 bit archs - fix autoconf data for libtool2 (patch by Tom Lane ... path in a script in utils...
Read more >
Untitled
Needed for oVirt - just a tag increase, because CVS is so awesome. ... to 4.17 - Update to 4.16 - Update to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found