Commit Graph

50 Commits

Author SHA1 Message Date
Sebastian Markbåge c8f7215b20 Use aliasify everywhere instead of browserify-global-shim (#7476)
I already had to aliasify to have better control over the requires
so we might as well do it everywhere for consistency.

This probably makes it easier to rebase the rollup work too
because aliases seems to be how you solve this in that world.
2016-08-11 20:17:37 -07:00
Sebastian Markbåge 1c5a639c37 Require the isomorphic React instead of internals from renderers (#7473)
This is needed for flat builds. It also lets us get rid of a bunch
of special cases in the build scripts.

It also allow us to just copy the source files into React Native
instead of having to build first to resolve the special cases.
2016-08-11 18:56:55 -07:00
Sebastian Markbåge f7e0db9a18 Build React DOM Fiber package (#7173)
This builds a `react-dom-fiber.js` bundle which exposes ReactDOMFiber.
This allows early experiments with the new Fiber reconciler.

I also expose it in the npm package through `react-dom/fiber`.
2016-08-10 18:45:14 -07:00
Sebastian Markbåge 0f004efce2 Build renderers into their individual npm packages (#7168)
This copies modules into three separate packages instead of
putting it all in React.

The overlap in shared and between renderers gets duplicated.

This allows the isomorphic package to stay minimal. It can also
be used as a direct dependency without much risk.

This also allow us to ship versions to each renderer independently
and we can ship renderers without updating the main react package
dependency.
2016-08-10 18:17:49 -07:00
Sebastian Markbåge ca9167c202 Include React itself in the list of shims (#7453)
Without this we end up bundling all of the isomorphic React into
the DOM bundle. This was fixed in #7168 too but I'll just do an
early fix to ensure that #7168 is purely an npm change.
2016-08-09 15:33:34 -07:00
Sebastian Markbåge 34c4474472 Fix trailing build issues (#7450)
Use relative path for addons UMD shim module

Use explicit top level wrapper marker for top level elements
2016-08-09 12:52:15 -07:00
Sebastian Markbåge 8ef00dbb7d Bundle DOM renderers into their individual UMD bundles (#7164)
* Cut out isomorphic dependencies from the renderers

These files reaches into isomorphic files.

The ReactElement functions are exposed on the React object anyway
so I can just use those instead.

I also found some files that are not shared that should be in
renderers shared.

* Found a few more shared dependencies

renderSubtreeIntoContainer is only used by the DOM renderer.
It's not an addon.

ReactClass isn't needed as a dependency since injection doesn't
happen anymore.

* Use a shim file to load addons' dependencies on DOM

By replacing this intermediate file we can do the lazy loading
without needing any lazy requires. This set up works with ES
modules.

We could also replace the globalShim thing with aliased files
instead for consistency.

* Bundle DOM renderers into their individual UMD bundles

Instead of exposing the entire DOM renderer on the react.js
package, I only expose CurrentOwner and ComponentTreeDevtool which
are currently the only two modules that share __state__ with the
renderers.

Then I package each renderer in its own package. That could allow
us to drop more server dependencies from the client package. It
will also allow us to ship fiber as a separate renderer.

Unminified DEV            after     before
react.js                  123kb     696kb
react-with-addons.js      227kb     774kb
react-dom.js              668kb     1kb
react-dom-server.js       638kb     1kb

Minified PROD             after     before
react.min.js               24kb     154kb
react-with-addons.min.js   37kb     166kb
react-dom.min.js          149kb     1kb
react-dom-server.min.js   144kb     1kb

The total size for react.min.js + react-dom.min.js is +19kb larger
because of the overlap between them right now. I'd like to see
what an optimizing compiler can do to this. Some of that is fbjs
stuff. There shouldn't need to be that much overlap so that's
something we can hunt. We should keep isomorphic absolutely
minimal so there's no reason for other React clones not to use it.
There will be less overlap with Fiber.

However, another strategy that we could do is package the
isomorphic package into each renderer bundle and conditionally
initialize it if it hasn't already been initialized. That way
you only pay an overlap tax when there are two renderers on the
page but not without it. It's also easier to just pull in one
package. The downside is the versioning stuff that the separate
npm package would solve. That applies to CDNs as well.

ReactWithAddons is a bit weird because it is packaged into the
isomorphic package but has a bunch of DOM dependencies. So we have
to load them lazily since the DOM package gets initialized after.
2016-08-09 12:39:03 -07:00
Paul O’Shannessy d17091ddeb Make Browserify-specific modules to remove DOM dependencies from npm package 2016-03-24 15:28:52 -07:00
Christoffer Sawicki ecf824cc2a Use loose-envify instead of envify
This reduces the number of transitive dependencies and decreases the build time (by ~6% on my machine).
2016-03-21 20:18:17 +01:00
Paul O’Shannessy 31f25255b9 Stop building JSXTransformer
Pick of/closes #4148.
2015-09-10 08:45:04 -07:00
Paul O’Shannessy 135c554b23 Move headers to shared location, use grunt templates 2015-09-08 22:00:05 -07:00
Paul O’Shannessy 7645c07720 Use eslintrc from fbjs 2015-08-31 23:05:04 -07:00
Paul O’Shannessy 6fc53e0438 Enable (and apply) global transforms with browserify
This ensures that we can consume code from npm that has our process.env pattern. Unfortunately we'll run the same transform on minified builds but it's pretty quick.
2015-07-23 17:52:58 -07:00
Paul O’Shannessy 5da408297f Remove in-browser unit testing
Rely on jest for now until we get a better and less hacky solution to running tests in the browser, probably a totally different test suite with different behavior/goals.
2015-07-17 00:13:16 -07:00
James Long ce61a49bca respect NODE_ENV environment variable if set when building 2015-07-08 14:45:21 -04:00
Benjamin Woodruff c089eece50 Switch to using comma-dangle: always-multiline
This is a machine-generated codemod, but it's pretty safe since it was
generated by hooking into eslint's own report.

A few files had to be touched up by hand because there were existing
formatting issues with nested arrays/objects:

src/shared/utils/__tests__/OrderedMap-test.js
src/shared/utils/__tests__/Transaction-test.js
src/shared/utils/__tests__/traverseAllChildren-test.js
src/isomorphic/children/__tests__/ReactChildren-test.js
2015-06-02 16:57:26 -07:00
Ben Alpert 8897b00989 Remove es3ify 2015-05-04 16:13:36 -07:00
Henry Zhu 07cfd66028 lint: remove spaces from object braces 2015-02-19 00:10:31 -05:00
chico 1511fff598 eslint 2015-02-13 02:43:42 +03:00
Rick Beerendonk 3e0750a4ad Update copyright headers for 2015 2015-01-31 20:18:25 +01:00
Andres Suarez 5c5fc5e316 Remove "derequire" from minified bundles 2015-01-27 16:53:18 -05:00
Cheng Lou 51d74ca36c Temporarily comment out bundle-collapser for JSXTransformer
This will at least make the examples run while we fix the issue.
2015-01-20 20:27:59 -05:00
ShihChi Huang 9bc1961936 apply browserify bundle collapser to all build type 2015-01-05 13:15:16 -08:00
ShihChi Huang f214776a97 use bundle-collapser to reduce browserified file size 2014-12-30 23:16:04 -08:00
Paul O’Shannessy d03d49101b browserify update 2014-10-14 22:40:28 -07:00
Paul O’Shannessy dcf415c2b9 BSD + PATENTS 2014-10-10 13:34:07 -07:00
Paul O’Shannessy 8d495f3b6e Revert "Merge pull request #1234 from RReverser/pure-cjs"
This reverts commit 7987e6a51d, reversing
changes made to d88d479685.
2014-03-18 11:25:21 -07:00
Ingvar Stepanyan 9e224e615f Renamed `browserify` tasks/configs to `cjs`, updated pure-cjs to 1.9.0 for better build speed. 2014-03-11 13:26:36 +02:00
Ingvar Stepanyan 3171436d97 Switched from browserify to pure-cjs bundler.
Optimizations and fix for JSXTransformer build.
Dropped dependency on emulation of Node.js native modules.
Added deamdify step for JSXTransformer build.
2014-03-08 16:33:58 +02:00
Paul O’Shannessy 3e77f64141 Merge pull request #1097 from spicyj/es3ify
Run es3ify over unminified builds
2014-02-16 12:49:16 -08:00
Ben Alpert e87c8a2aa4 Run es3ify over unminified builds
Makes no difference to react.js and react-with-addons.js; quotes .static in four
places for JSXTransformer.js:

https://gist.github.com/spicyj/aada5352e813752a4667
2014-02-15 16:32:36 -08:00
Paul O’Shannessy d3c12487fd Update copyright header in browserify config
Part of #1006, but sooner.
2014-02-15 16:24:13 -08:00
Ben Newman 77c53dd5d4 Revert "More optimizations and fix for JSXTransformer build"
This reverts commit f1b7db9aef.
2014-02-03 19:05:15 -05:00
Ben Newman e994e06c54 Revert "Removed redundant uglification"
This reverts commit 86373d924c.
2014-02-03 19:05:09 -05:00
azure provisioned user 86373d924c Removed redundant uglification
Removed uglification for separate files since it significantly slowed down build (browserify:min became 26 sec instead of 110, same for :addonsMin) while gave economy in ~70 bytes for min+gz version.
2014-02-03 22:06:38 +00:00
Ingvar Stepanyan f1b7db9aef More optimizations and fix for JSXTransformer build
* Dropped dependency on emulation of Node.js native modules.
* Added deamdify step for JSXTransformer build.
2014-01-31 21:53:08 +02:00
Paul O’Shannessy ca930efa7c Upgrade (explicitly) grunt
They deprecated the use of some packaged modules and suggest using those modules
directly. http://gruntjs.com/blog/2013-11-21-grunt-0.4.2-released

Lodash was the only use we had.
2014-01-17 18:00:40 -08:00
Ben Alpert 76c9d8465e Switch to using uglifyify 2013-12-29 00:03:26 -07:00
Ben Alpert abee8b0476 Minify both before and after browserify 2013-12-28 23:41:54 -07:00
petehunt 82f211f6b8 revert muffinize :( 2013-12-06 11:56:30 -08:00
petehunt 90e2258791 response to code review 2013-12-06 11:56:30 -08:00
petehunt e839405202 muffinification 2013-12-06 11:56:29 -08:00
petehunt 5466d0a063 first work: __DEV__
fix invariant

Get browserify working

remove dead code elimination step since it is not needed due to minifier

use industry standard NODE_ENV
2013-12-06 11:56:29 -08:00
Thomas Aylott 8f96ec255b new grunt browserify:withCodeCoverageLogging task 2013-11-18 16:37:47 -05:00
Paul O’Shannessy 2e6092b217 react-with-addons build
This creates a new standalone build which should have everything the
default build has, plus a little extra. This is not a sustainable long
term solution (we shouldn't make people choose like this) but it fixes
the problem we have in the short term.

This also removes the terrible react-transitions build. This is better
anway.

Fixes #369
2013-10-08 16:49:11 -07:00
Paul O’Shannessy d704bc24f4 Initial build of ReactTransitionGroup
This builds `ReactTransitionGroup` with it's own copy of `React`, which
it total clownshoes. This should be technically usable, but definitely
should not be used in any production environment.
2013-09-07 16:18:14 -07:00
Ben Newman 0827646695 Use populist for building jasmine test harness package.
We're using populist for building the bundle of test modules and their
dependencies, so it seems worthwhile for consistency to do the same for
the test harness.
2013-07-16 14:48:31 -04:00
Ben Newman 009c0b9200 Expose test modules for requirement. 2013-06-03 13:20:13 -04:00
Ben Newman f8af93237a Use bin/jsx and browserify to build a jasmine bundle. 2013-06-03 13:20:13 -04:00
Paul O’Shannessy 75897c2dcd Initial public release 2013-05-29 12:54:02 -07:00