Commit Graph

17 Commits

Author SHA1 Message Date
Evan Scott
bef754dc27 prettier 2018-09-30 16:56:22 -05:00
Bhargav Ponnapalli
a95bbfaa15 Add component-based global styling API (#1867)
* Initial work to add createGlobalStyle functionality

* Delete global styles when component returned from createGlobalStyle is unmounted

* Check context for stylesheet instance

* Adjust the size of the browser style sheet after removing a textNode

* Add initial implementation of removeComponent to ServerStyleSheet

* Tidy up code as part of createGlobalStyle addition

* Added printWidth to .prettierrc

* Add createGlobalStyle information to CHANGELOG

* Increase bundle size

* Remove duplicate inject property

* Add missing removeComponent method

* Add basic test cases for createGlobalStyle

* Add mutation test cases

* fixup! Make tests work by pulling CONTEXT_KEY into StyleSheetManager locally

* Basic implementation for interpolation and theme support

* Test and WIP implementation for theme updates

* Use correct theme update color

* Add missing type annotations

* Reimplement on top of GlobalStyle and StyleSheet

* Add failing case for multiple rules

* Use CSSConstructor correctly

* Remove unused imports

* Revert obsolete change

* Improve test harness

* Add support for multiple GlobalStyle components

* Update test results

* Revert obsolete change

* Revert unrelated change

* Explain purpose of static execution context

* Fix flow issues

* Fall back to null when children are not passed

* Increase bundle size limit to 16.5kB

* Be more explicit about getCSS scope

* Avoid type errors for subscribe ob production builds

* Mark withTheme usage as stop-gap measure

* Warn about createGlobalStyle children being ignored

* Add SSR test for createGlobalStyle

* Increase commonjs bundle size to 12kB

* Add a deprecation warning on `injectGlobal`. Resolve unrelated typo.

* adjust changelog

* Remove unnecessary ThemeProvider usage in Test case

* Decrement start index in removeRules

* Merge changes from develop

* Update createGlobalStyle to new Context api

* Fix typo in CHANGELOG.md

* Remove package-lock.json and add to gitignore

* Move global style updation into render method for GlobalStyleComponent

* Throw error if children passed as props for createGlobalStyle component

* Remove package.lock.json from sandbox

* Remove injectGlobal API, replace it with createGlobalStyle in test cases

* Unskip working test cases

* Make changes based on feedback to PR

* Remove injectGlobal.test.js.snap from tests

* Replace injectglobal with createGlobalStyle in example

* Add createGlobalStyle to standalone and no tags builds

* adjust changelog
2018-08-27 01:03:01 -05:00
Evan Scott
d648606a09 fix standalone browser build (#1927)
* fix standalone browser build

something about the "umd" setting in recent versions of rollup
just doesn't work properly

* fix integration tests

* go away flow
2018-08-17 16:53:14 -05:00
Alexander Nanberg
f242f9acdb Use new context API (#1894)
* Update ThemeProvider to use new context API

* Fix flow

* Set theme as context

* Fix nested ThemeProviders

* Add ThemeProvider tests

* Add missing propagation test

* Improve ThemeProvider propagation test

* Rename children spy function

* Add flow types

* Upgrade withTheme to use new context

* Migrate StyledComponent to use new context api

* Add ThemeContextShape type

* Cache ThemeConsumer render function

* Upgrade enzyme and revert back tests

* Update lockfile

* Migrate StyleSheetManager

* Use StyleSheetConsumer

* Fix StyleSheetManager tests

* Update ssr snapshot

* Revert back enzyme adapter

* Remove extraneous dependency

* Cleanup context shape

* Fix tests

* Add StyleSheet type and EMPTY_OBJECT

* Update lockfile

* Fix jest/jsdom localStorage errors

* Migrate StyledNativeComponent

* Fix integration test

* Fix some primitive tests

* Fix tests

* Fix flow

* Fix flow

* Update memoize-one flow-typed

* Add StrictMode test

* Remove extraneous dependencies

* Cleanup flow definitions

* Fix import statement

* Change react peerDependency

* Rename variable

* Add changelog entry

* Cleanup import statement

* Fix errors after merge

* Refactor ThemeProvider test to use withTheme and styled
2018-08-12 01:58:07 -05:00
maciej-ka
70b2acf501 feat: screenshot test 2017-12-16 21:35:38 +01:00
Glen Maddern
29b277a959 removing old ssr example 2017-04-14 18:16:57 +10:00
Glen Maddern
83ef8968c3 trying to get the example SSR with rehydration to work, but so far no luck 2017-04-14 18:13:01 +10:00
Glen Maddern
13674df56b ok the simple ssr test is passing but this has fundamental problems 2017-04-11 19:17:47 +10:00
Glen Maddern
022c207658 Ok I've found the problem and... oh dear. 2017-04-11 19:00:10 +10:00
Glen Maddern
ae3538d8e6 refactored the whole tag interface and figured out how Flow works 2017-04-11 17:42:32 +10:00
Glen Maddern
868696a47b found a nasty edge case but keyframes are now looking good 2017-04-11 15:27:23 +10:00
Glen Maddern
cc61bf914b better, we can simplify the DOM output by only recording names, but still using hashes as a cache 2017-04-11 11:04:46 +10:00
Alan Smithee
9a184feaae adds simple ssr example 2017-01-21 17:09:03 +00:00
Jamie Dixon
2d486bde89 Created an example page with perf stats 2016-10-24 20:45:10 +01:00
stephen.kingsley
a4cdd21ccb remove npm run build:dev 2016-10-18 23:57:34 +08:00
stephen.kingsley
9abbe24bb1 move devServer to example/ 2016-10-18 23:53:07 +08:00
stephen.kingsley
ca02607f0c add example page and dev server 2016-10-18 23:34:33 +08:00