Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Smaller data for client-side builds #1827

Closed
ai opened this issue Aug 23, 2015 · 5 comments
Closed

Smaller data for client-side builds #1827

ai opened this issue Aug 23, 2015 · 5 comments

Comments

@ai
Copy link
Contributor

ai commented Aug 23, 2015

Some React guys think about using Autoprefixes in client side. It is not a best solution, but will be good for universal/isomorphic JS, when we need to prerender SPA on server-side and didn’t know about browser.

An main problem of using Autoprefixer on client side is Can I Use dump size. And the main problem is that we need only few subset on this data.

So it will be very useful if we have minimized version of data. Like caniuse-db/support-json/css-animation.json:

{
  "ie": {
    "5.5 9": "n",
    "10 11": "y"
  }
  
}

I use space between versions, because - is already used in some versions names.

/cc @Fyrd

@ai
Copy link
Contributor Author

ai commented Aug 23, 2015

@Fyrd this task is very important for Autoprefixer, so tell if you need any help

@Fyrd
Copy link
Owner

Fyrd commented Aug 24, 2015

@ai I don't see why this isn't something Autoprefixer couldn't generate itself? You'd know better what the ideal minimized format would look like for your purposes so I'm not sure why it would need to happen in the caniuse repo.

@ai
Copy link
Contributor Author

ai commented Aug 24, 2015

Yeap, the other solution is to have some “middleware” npm package, which will compress Can I Use data.

But this “middleware” will be a lack for actual data. We need a Can I Use release first, then I need to run compress scripts and release my npm package.

In previous versions Autoprefixer has own data copy, but in practice it was not good soluion :(.

@ai
Copy link
Contributor Author

ai commented Aug 24, 2015

Autoprefixer can’t compress Can I Use data on-the-fly, because problem is with Browserify/webpack, which will add to bundle all require files.

@Fyrd
Copy link
Owner

Fyrd commented Aug 25, 2015

While I understand it would make things more convenient to do this at the caniuse level, I don't think it's a good idea to start building custom data files just to make things easier for any given project that uses the data. If I started doing this for autoprefixer other projects might also start making similar requests and it would become very hard to maintain things.

So I feel it's best to have the data the way it is, same for everyone, and let individual projects find their own ways to process it in whatever way meets their needs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants