GithubHelp home page GithubHelp logo

Comments (20)

silvenon avatar silvenon commented on May 19, 2024 2

Why does react-flexbox-grid require a module bundler?

For CSS Modules to fully work. A precompiled distribution might cause name conflicts (unlikely, but still) and you wouldn't be able to use composes feature for the flexboxgrid module etc.

The requirement is still slightly silly, I agree. We'll think of something…

from react-flexbox-grid.

drouillard avatar drouillard commented on May 19, 2024 2

@silvenon To add perspective of someone just starting with project.. CSS Modules also makes this project incompatible with create-react-app as there is not the ability to run custom loaders by default.

Overall great project though. Thanks for effort.

*edit Tried out spec project included in this repo and the class names being created look better. Still being 'localized' but at least can tell which classes are being used. In my large project the classNames seemed completely mangled. I was able to fork and remove css modules easy enough though.

from react-flexbox-grid.

MechJosh0 avatar MechJosh0 commented on May 19, 2024 1

@nadeemja I had the same problem but couldn't get it to bundle with Meteor.

I too wanted to avoid using Meteors package system so I went with react-mdl. This follows the Material specification by Google by using getmdl and turning it into easy React components.

The only problem with this is that you cannot link to the /extra folder as mentioned in their requirements due to Meteors build system. Instead I copied the css/js files into the Meteor /client/ folder, in the future I plan to create a script which will do this automatically when the files update but right now it's manually. Hopefully MDG will allow linking to a node_modules file in the future but for the time being you have to hack it.

Sorry this isn't a solution for react-flexbox-grid, but I hope it solves your problem.

from react-flexbox-grid.

SpencerSharkey avatar SpencerSharkey commented on May 19, 2024 1

πŸ‘ for this... I don't want to require webpack for this single (awesome) module

from react-flexbox-grid.

silvenon avatar silvenon commented on May 19, 2024

Which module bundler are you using instead?

from react-flexbox-grid.

nadeemja avatar nadeemja commented on May 19, 2024

Hi!

I'm using MeteorJS.

from react-flexbox-grid.

silvenon avatar silvenon commented on May 19, 2024

I'm not familiar with Meteor, does #32 help?

from react-flexbox-grid.

nadeemja avatar nadeemja commented on May 19, 2024

Sort of. Using a meteor-package does work, but I'm trying to stay on a npm-only path. Why does react-flexbox-grid require a module bundler?

from react-flexbox-grid.

Nico-L avatar Nico-L commented on May 19, 2024

Hi,

πŸ‘ also. I am using meteor +react and would like to avoid using webpack.

thanks

from react-flexbox-grid.

silvenon avatar silvenon commented on May 19, 2024

@roylee0704 is using CSS Modules really necessary for this library? It's really simple and I doubt that there would be name clashes because people usually use only one grid system per project. Or perhaps we could make two distributions, one default and the other one for webpack?

from react-flexbox-grid.

fortunto2 avatar fortunto2 commented on May 19, 2024

@nadeemja
Hi, look my fork of package https://atmospherejs.com/lifefilm/react-flexbox-grid
without webpack

from react-flexbox-grid.

nomadtechie avatar nomadtechie commented on May 19, 2024

Would like to be able to use this with JSPM so adding another vote. :-)

from react-flexbox-grid.

PolGuixe avatar PolGuixe commented on May 19, 2024

For meteor users you can try to use https://github.com/nathantreid/meteor-css-modules.

However I haven't been able to do a working set-up :( See: akanix42/meteor-css-modules#66

from react-flexbox-grid.

yanickrochon avatar yanickrochon commented on May 19, 2024

Since Meteor can effectively import CSS now, why isn't this module simply not adding flexboxgrid to it's peer dependencies and let users load it however they want? Then simply apply the darn CSS classes like it can be done manually?

Because this actually works

<div className="row">
  <div className="col-xs-12 col-sm-4 col-md-3 col-lg-2">
    Foo
  </div>
</div>

So I'm wondering why this doesn't work

<Row>
  <Col xs={6} sm={4} md={3} lg={2}>
    Foo
  </Col>
</Row>

from react-flexbox-grid.

silvenon avatar silvenon commented on May 19, 2024

why isn't this module simply not adding flexboxgrid to it's peer dependencies

It is.

Then simply apply the darn CSS classes like it can be done manually?

Because this module is intended exclusively for CSS Modules. We should make it fall back to regular classes if CSS Modules aren't used, but I'm not sure how easy (or possible) that is.

from react-flexbox-grid.

silvenon avatar silvenon commented on May 19, 2024

But the more I think about it, the more I'm leaning towards advising you to simply use the flexboxgrid module + classes directly. If you aren't going to use CSS Modules, using react-flexbox-grid to get to flexboxgrid seems like an unnecessary middle step.

from react-flexbox-grid.

yanickrochon avatar yanickrochon commented on May 19, 2024

@silvenon perhaps. Then again, if you argue like this, so is this module, then. No? πŸ˜›

from react-flexbox-grid.

silvenon avatar silvenon commented on May 19, 2024

@yanickrochon sorry, could you rephrase that? I would love to hear reasons for using this module without CSS Modules, I just didn't understand the sentence. πŸ˜…

from react-flexbox-grid.

yanickrochon avatar yanickrochon commented on May 19, 2024

@silvenon When I came down to choose between two Material Design UI frameworks, I had the choice between MaterializeCSS + React-Materialize (which includes a flex grid already) or Material UI and Flexbox Grid.

The interesting thing is that the latter (Material UI) does not use any CSS, but does everything inline with styles (that can be overridden either with style props or through CSS and !important instruction. Even material icons are bundled as React Components, drawing SVG elements directly. The point being that CSS is not a requirement anymore, especially if the rules are generic and functionality wrapped in components.

This project is pretty similar, in the sense that the requirement on Flexbox Grid makes the entire thing big and quite useless, as you pointed out, as people can simply include flexboxgrid's CSS and use it directly, even in react. However, bundling the styles as standalone react component, compatible with FlexBoxGrid (the end result is the same, and the API doesn't change) makes the project work seamlessly in any react environment, because there are no dependencies.

Ideally, this is how I see this kind of project. Because it's better to change a single component than to refactor the entire app for every instances of <div className="row"> and such.

from react-flexbox-grid.

silvenon avatar silvenon commented on May 19, 2024

Please subscribe to #60 to receive updates about react-flexbox-grid falling back to regular classes in case CSS Modules aren't enabled.

from react-flexbox-grid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.