Closed tabazevedo closed 9 years ago
I'm hesitant about this. Can we not detect the possible options somehow internally? If not, I'd rather provide the individual transpiler configs as dependencies.
The reason I say this is we're locking ourselves to webpack as a build mechanism and we don't know that is going to be a long-term thing. If you enable configuration files in the project, you can only ever change the build tool in a major version release. The build abstraction is leaking it's internals and I'd like to avoid that if at all possible...
rant So, I can see where you're coming from however we are already tied into webpack for the moment. Its likely that plugins won't become a thing until ^0.4 and although I share your sentiment for user apps breaking, people have to remember that until we are 1.0 it's likely that stuff will break often.
The server module at the moment requires LiveScript regardless of what language you're using which IMO is worse than being slightly more opinionated about webpack until we have a plugin system ready.
There's also currently no way to make the bundler support another language, aside from running on a different branch or running a fork of Reflex that's parallel to master but with a different bundler configuration, which we want to avoid as it would mean rebasing every update and potentially being behind on features all the time. end rant
So yes, we are tied into webpack in the back, but the application isn't. That's my whole point. From the app developer's point of view, Reflex builds the bundle. The fact that webpack is in there is an implementation detail. I'm not even thinking just till 1.0, because webpack is unlikely (well, I say that...) to get replaced by something better soon, but eventually we'll find a reason to switch to something else and then you'll have a lot of work explaining yourself to all the users (optimism) and transitioning them to the new thing. Don't create work for our future self. Postpone decisions as much as you can.
I would rather make the server/bundler a little (or even quite a bit) dirty until we have a plugin system which will let us solve this in a transparent way, then clean it up, than introduce a new unnecessary dependency into people's applications.
Can we not literally run the user's code through all the five or six things we can think of? Or even easier, just LiveScript and babel, because those are the two things we know we need. Or are they conflicting with each other...?
@StuartHarris What do you think about this? Am I being paranoid?
Discussed, see https://github.com/redbadger/reflex/pull/32
Allows use of a
webpack.config.js
file in an application root directory to specify custom loaders which will be merged with the default Reflex config.ES6
LiveScript
You'll also have to specify server dependencies so it can
require
your app.ES6
LiveScript
The
reflex-server
binary will automatically read from this server.js file, so you don't need to change your start scripts (although you can if you want!)