This repository was archived by the owner on May 28, 2019. It is now read-only.
Open
Conversation
src/runInContext.js
Outdated
Author
There was a problem hiding this comment.
Making this work with noConflict is going to be interesting, since noConflict isn't a module, but a browser-only function that's injected by the webpack WrapperPlugin. We'd need to make noConflict context-aware...
build.js
Outdated
added 11 commits
April 9, 2015 11:48
* Add `makeRunInContext`. * Modularize `build.js`. * Use Bower to download the Closure Compiler.
Expose `noConflict` in CommonJS environments. Add an optional `preventNoConflict` flag to `runInContext` that controls whether `noConflict` is a no-op. This flag is used when exporting for CommonJS environments, where the global scope is not modified.
Add missing `nextTask` callback to `compress`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This breaks
json3.jsinto separate CommonJS modules that are stitched together with webpack. The source files are usable as separate modules—requiring them imports themake*factories that return the exported methods—but it's a little tricky withrunInContext,has, and our export system. For now, I just added a webpackWrapperPluginthat wraps the build inbuild/assets/{header, footer}.js.Various functions from
build.jshave also been moved into their own modules. I investigated switching to gulp (4.0 adds a lot of nice conveniences), but held off for now...we're using a lot of custom, non-streaming transforms, and I don't think we need one-offgulp-json3-*plugins.getCompilerand friends have been removed entirely; Bower can download and cache the Closure Compiler for us.@D10 I'd love your feedback, whenever you have some spare cycles. I expect this will need a lot more polish before it's ready for merging. 😸
There is a slight increase in the size of the minified version, but I think it's acceptable—especially if we can do custom builds in the future that remove some of the corner cases (e.g.,
Date#toJSONfixes).masterfeature/webpack