Skip to content

Online build tool for custom small builds #874

Open
ahocevar opened this Issue Jul 18, 2013 · 8 comments

5 participants

@ahocevar
OpenLayers member

For app developers that do not use Closure, we will want to make it easy to create custom builds without setting up a whole tool chain. Especially mobile devices will benefit from reducing the amount of code that needs to be interpreted on the client.


Want to back this issue? Place a bounty on it! We accept bounties via Bountysource.

@pagameba
OpenLayers member
@ahocevar
OpenLayers member

Thanks for the hint @pagameba - I haven't thought of ways to do this yet, so this is very helpful.

@elemoine
OpenLayers member

Note that with the Closure Compiler in advanced mode the ol code added to the build is determined by the exports. The exports effectively determine the roots of the code dependency trees. So, as I see it, a custom build tool would be based on the exports (be the tool a CLI or an online tool). And we can group exports as features - users don't select exports, they select features. So when the user checks the "Bing Maps" feature the tool builds the lib by including all the Bing Maps related exports included.

There actually is something that determines what code is included in the build: @define's. With @defines we can exclude functionality that are not directly related to the API. Let's say I want to exclude WebGL support entirely. We have a @define for WebGL already, so we can should be able to get a WebGL-free build by passing --define='ENABLE_WEBGL=false' to the compiler. We have a number of @define's in the lib already, and we could add more where it makes sense.

@tschaub
OpenLayers member
tschaub commented Jul 19, 2013

Sorry to have missed the hangout this week. I'm back in the office next week. I've got ideas about how this should work and be hosted. If nobody else has taken it on, I'd like to.

@probins
probins commented Jul 21, 2013

And we can group exports as features - users don't select exports, they select features. So when the user checks the "Bing Maps" feature the tool builds the lib by including all the Bing Maps related exports included.

this sounds like a sort of modular build: a Bing module, a vector module, a vector edit module, a vector edit toolbar module etc. Would this be at the source file level or are you thinking of something more fine-grained? Having some exports from a source file but not others? If the former, I'm thinking you might be able to use closure's modules.

@probins
probins commented Jul 23, 2013

the other way of doing this is for the user to POST their code to the server, and the server compiles it in with ol3. Then you don't need exports, but you probably do need linter checks on the user code.

@probins
probins commented Aug 14, 2013

ideally, this would also include custom css

@tschaub tschaub self-assigned this Mar 13, 2014
@tschaub
OpenLayers member
tschaub commented Apr 10, 2014

See #1979 for ongoing work.

@tschaub tschaub removed the feature label Sep 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.