Giter VIP home page Giter VIP logo

Comments (15)

olivergeorge avatar olivergeorge commented on August 18, 2024

Eric, in the OL3 forum, pointed to Google Closure features for matching namespaces to files. I guess that's the familiar top level script when you build without optimisations.

Namespaces (defined with good.provide) and file names are independent. You can even have files that goog.provide multiple namespaces. And you to have some script to create addDependency statements defining the dependencies tree and the matching between provided namespaces and files. This is what Closure Library's depswriter.py script does.

I guess that could provide the necessary mapping but that's speculation. I'm sure David or one of the other compiler devs will be able to give some concrete advice.

from packages.

martinklepsch avatar martinklepsch commented on August 18, 2024

Ok. Pretty sure we can package this stuff as native Closure libs. I'll see if I can pull together an example.

from packages.

swannodette avatar swannodette commented on August 18, 2024

@olivergeorge for Closure libraries that follow Java classpath naming conventions wrt. to their name there's nothing to do. For Closure libraries that do not there is the :libs features. I haven't used it so it needs to be verified that it hasn't regressed.

from packages.

martinklepsch avatar martinklepsch commented on August 18, 2024

So that was actually pretty straightforward. I put it together for openlayers in a native-closure branch.

I don't want to merge/deploy that yet though. I'd like to keep things as consistent as possible for end users. Sprinkling this repo and the cljsjs group on clojars with jars that work differently than existing ones is most likely going to lead to confusion.

Suggestion: move Closure libs into another repo (closure-libs) and create a new group on Clojars (cljsjs-closure). Any opinions on that?

from packages.

martinklepsch avatar martinklepsch commented on August 18, 2024

Oh just in case that's not clear: packaging things like OpenLayers with :libs allows it to be used just like regular Closure libs/Clojurescript namespaces. This allows us to selectively pull in what's needed and enables the full suite of Closure optimization features like dead code elimination.

(ns my.app
  (:require [ol.animation :as anim])
  (:import ol.Map ol.source.MapQuest))

from packages.

jeluard avatar jeluard commented on August 18, 2024

Great stuff!
So is it the ClojureScript compiler that does all the goog.provide -> filename conversion?

move Closure libs into another repo (closure-libs)

I do think it would be sufficient to specify this is a closure library in the readme. Not sure creating an extra repo is worth it.

from packages.

martinklepsch avatar martinklepsch commented on August 18, 2024

I also like the idea of splitting things up for the sake of discoverability but we can leave that for another day.

from packages.

olivergeorge avatar olivergeorge commented on August 18, 2024

Looks to have worked like a charm. My example file size is sane and it's working.

from packages.

olivergeorge avatar olivergeorge commented on August 18, 2024

What's the next step on this? I'll use it in a current project so it would be nice if it was uploaded to clojars.

from packages.

martinklepsch avatar martinklepsch commented on August 18, 2024

@olivergeorge Uploading 3.1.1-1 right now. If you'd like to get 3.2 please update it via PR.

@olivergeorge @jeluard if anyone of you guys feels like helping with maintaining this I'm happy to add you as contributors. I'm planning to write up some CONTRIBUTING.md to make this easy peasy 🌞

from packages.

olivergeorge avatar olivergeorge commented on August 18, 2024

I'd be pleased to be a contributor and help out. I think I'll be doing
plenty of cljs work this year.

On 10 February 2015 at 21:26, Martin Klepsch [email protected]
wrote:

@olivergeorge https://github.com/olivergeorge Uploading 3.1.1-1 right
now. If you'd like to get 3.2 please update it via PR.

@olivergeorge https://github.com/olivergeorge @jeluard
https://github.com/jeluard if anyone of you guys feels like helping
with maintaining this I'm happy to add you as contributors. I'm planning to
write up some CONTRIBUTING.md to make this easy peasy [image:
🌞]


Reply to this email directly or view it on GitHub
#28 (comment).

from packages.

martinklepsch avatar martinklepsch commented on August 18, 2024

@olivergeorge added you to the @cljsjs/contributors group :)
I'm closing this now as the Closure question as been answered :)

from packages.

jeluard avatar jeluard commented on August 18, 2024

@martinklepsch Do you mind adding me as a contributor? I'd like to add some details to the README.

from packages.

martinklepsch avatar martinklepsch commented on August 18, 2024

@jeluard done/

from packages.

jeluard avatar jeluard commented on August 18, 2024

Thanks!

from packages.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.