Fix react-jss exports from jss-starter-kit#1001
Conversation
| export * as reactJss from 'react-jss' | ||
| export {SheetsRegistry, SheetsManager, createGenerateId} from 'jss' | ||
|
|
||
| export { |
There was a problem hiding this comment.
hmm, that was supposed to be exported as exports.reactJss.withTheme , so that its in reactJss namespace
There was a problem hiding this comment.
But then you couldn’t import them directly which isn’t user-friendly in my opinion
There was a problem hiding this comment.
Its not too user friendly, but on the other hand, those exports might have potential collision now and because we need to maintain the named exports here ass well.
There was a problem hiding this comment.
What if we export everything under one namespace but in a dynamic way? without maintaining each export name manually?
There was a problem hiding this comment.
I don't think there is a way to have every member exported right now. Rollup doesn't bundle something like export * from 'react-jss correctly I believe.
@TrySound do we need to enable something to support this syntax?
There was a problem hiding this comment.
Rollup is able yo handle export * syntax just fine. It expands it into named imports internally.
Export * as ns is not supported since its not a part of spec yet.
There was a problem hiding this comment.
Ah, I see. It does not expand this because it doesnt know about external dependency. Who resolves this incorrectly? Webpack?
There was a problem hiding this comment.
We aren't using webpack anymore, at least not for building.
There was a problem hiding this comment.
So what is the problem? Rollup will show collisions if you will bundle react-jss dep in umd.
There was a problem hiding this comment.
Figured it out. The problem was that react-jss wasn't declared a dependency of jss-starter-kit.
|
I don't think we should export |
What would you like to add/fix?
Fix
react-jssexport and add some missing exports fromjssCorresponding issue (if exists): #948