-
Notifications
You must be signed in to change notification settings - Fork 79
Conversation
…-container external, so the umd builds are not bloated with 3rd party deps
…bs on babel level instead of webpack level
…ComponentTheme is used without global BaseTheme
😰 |
@@ -1,58 +0,0 @@ | |||
# No Customizing `className`'s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we deleting this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess because we use Fela, it will generate className automatically
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it's still true but we need to expose classNames so Fela can inject styles into the components. Eventually, I'm going to write some new pieces explaining the whole Fela thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the whole no className
thing still applies. Customizing the classes through Fela is not the same as customizing it directly. Its probably worth explaining.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It definitely does, I just don't want to confuse people with "no classNames" article and then exposing classNames everywhere without explaining Fela bits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree the current article is confusing given our current implementation. We don't have to do it in this PR but we should talk about separation of concerns at some point. The idea here is that the component is responsible for functionality and Fela is responsible for style, and modifying className
without Fela violates that.
@@ -1,53 +0,0 @@ | |||
# No ES6 Modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I might update this rather than deleting it, explaining why we chose webpack2 etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea. I'll write something but later.
"presets": ["es2015", "react"], | ||
"plugins": ["transform-object-rest-spread"] | ||
"presets": [ | ||
["es2015", { "modules": false }], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
obviously, it is out of the scope of this PR, is it agreed not to use ES modules in this repo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR changes everything to ES6 modules. Now, there's webpack2 that can handle them so there is no need for babel transformation which was main reason why not to use them before.
build.sh
Outdated
@@ -0,0 +1,10 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please move into scripts folder
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
$ git tag -a "[[version]]" | ||
$ npm publish | ||
$ git push origin master --follow-tags | ||
npm run publish |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if someone wants to publish single/multiple packages is the 'npm run publish' will be used in both cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, lerna has a nice interface to select what and how to publish
@@ -21,7 +21,7 @@ functions that take state and render UI. | |||
A unit test for state => ui looks something like this: | |||
|
|||
```js | |||
it('should render the list of items', function() { | |||
test('should render the list of items', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could update using () => {}
syntax
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
"babel-generator": "^6.18.0", | ||
"babel-loader": "^6.3.2", | ||
"babel-jest": "^19.0.0", | ||
"babel-loader": "7.0.0-alpha.3", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are you sure it is a good idea using alpha version?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea, because of this babel/babel-loader#391
const React = require('react'); | ||
const { render } = require('react-dom'); | ||
const { PaginationBuilder } = require('../../src/index'); | ||
import React from 'react'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we change from common.js to es6 modules syntax. Is it not enough to bump package version of all components?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what you mean by this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the module syntax for our imports doesn't represent a SEMVER incompatible API change, as far as I'm aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The actual /lib
output should be identical. The main index.js
is still commonjs module. But now we add /es
target where ES6 modules are preserved and webpack2 or rollup can leverage that. Also /dist
target for UMD builds - I'm going to put them on cdnjs.com.
Changes
npm start
and enjoy hot module replacement. You can build/docs
throughnpm run build:styleguide
.I didn't change functionality of any component. Everything's related only to the build process, style guide and testing.
There are probably some small errors in the style guide. Let's fix them later!