Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bundle assets in slim loader #848

Merged
merged 10 commits into from Sep 30, 2017
Merged

bundle assets in slim loader #848

merged 10 commits into from Sep 30, 2017

Conversation

pYr0x
Copy link
Contributor

@pYr0x pYr0x commented Sep 22, 2017

blocked by: stealjs/steal-bundler#30

this PR integrates steal-serviceworker
and close #846 and close #825

the code i added can definitely refactored.

// run external steal-tool plugins after the build
				if(options){

					var p = Promise.resolve(builtResult);

					if(options.bundleAssets){
						var bundleAssets = require("steal-bundler");
						p = p.then(function(builtResult) {
							return bundleAssets(builtResult, options.bundleAssets);
						});
					}

					if(options.serviceWorker){
						var precache = require("steal-serviceworker");
						p = p.then(function (builtResult) {
							return precache(builtResult, options.serviceWorker);
						});
					}
				}

				p.then(function (builtResult) {
					resolve(builtResult);
				}).catch(function (error) {
					reject(error);
				});

but for now we can live with that.

maybe we can create some API for post-plugins like steal-bundler, steal-serviceworker and steal-electon that need the buildResult.

cc @matthewp @m-mujica any thought how we can do this?

}, function(err){
reject(err);
writeStream.on("data", function(builtResult){
//this.end();
Copy link
Contributor Author

@pYr0x pYr0x Sep 22, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewp dont know whats that function is doing. if i comment it out, it worked for the multibuild, the slim build doesnt have one https://github.com/stealjs/steal-tools/pull/848/files#diff-b016b898f98b8eb1dc4d58c367f1bc38R99
is this.end() necessary?

@pYr0x pYr0x requested a review from matthewp September 23, 2017 06:41
@coveralls
Copy link

coveralls commented Sep 24, 2017

Coverage Status

Coverage increased (+0.01%) to 92.679% when pulling 04d4207 on serviveworker into b923be1 on master.

@pYr0x
Copy link
Contributor Author

pYr0x commented Sep 25, 2017

the test does not pass because travis-ci runs steal-tools on node 4 and steal-serviceworker supports node 6+
@matthewp any possibility to drop support for node 4?
otherwise i have to transpile the serviceworker script to node 4

@matthewp
Copy link
Member

We can't drop Node 4 until steal-tools 2.0. Looking at the build error: https://travis-ci.org/stealjs/steal-tools/jobs/279253395

I'm not sure it's a syntax problem... have you tried running it in Node 4 locally?

@pYr0x pYr0x changed the title integrate service worker and bundle assets in slim loader bundle assets in slim loader Sep 25, 2017
@pYr0x
Copy link
Contributor Author

pYr0x commented Sep 25, 2017

remove the integration of serviceworker because transpiling the source script to node 4 cause problems and i dont want to refactor steal-serviceworker.

this PR is still blocked by: stealjs/steal-bundler#30

@coveralls
Copy link

Coverage Status

Coverage increased (+0.09%) to 92.758% when pulling 0d933cb on serviveworker into b923be1 on master.

1 similar comment
@coveralls
Copy link

coveralls commented Sep 25, 2017

Coverage Status

Coverage increased (+0.09%) to 92.758% when pulling 0d933cb on serviveworker into b923be1 on master.

// p = p.then(function (builtResult) {
// return precache(builtResult, options.serviceWorker);
// });
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather not leave in commented out code... you never know when we'll be able to uncomment it out, so I think it's better to add it back when/if we are able to integrate steal-serviceworker.

// p = p.then(function (builtResult) {
// return precache(builtResult, options.serviceWorker);
// });
// }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@coveralls
Copy link

coveralls commented Sep 30, 2017

Coverage Status

Coverage increased (+0.09%) to 92.78% when pulling ceb089d on serviveworker into 0abee93 on master.

@matthewp matthewp merged commit 99a0eb0 into master Sep 30, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bundleAssets is not working with optimize build bundleAsset test removed?
3 participants