Git Product home page Git Product logo

Comments (4)

papandreou avatar papandreou commented on September 26, 2024

It's not quite as easy as that, but we could add a buildProduction switch that did buildDevelopment's flattening of the JavaScript includes before proceeding. I don't understand see how the use case you're describing could work, though.

JavaScriptOneInclude and JavaScriptCommonJsRequire won't work if your development version hasn't been through something like buildDevelopment. (Of course, require.js will work fine).

Also, the i18n features rely on the 'bootstrapper' script in development, so you'll need buildDevelopment eventually.

from assetgraph-builder.

Munter avatar Munter commented on September 26, 2024

I'm just trying to sell buildProduction to users as an easy way to get started. If it then behaves as they wouldn't expect it's not an easy sell :)

I thought that the only reason why INCLUDE wouldn't be populated in buildDevelopment is that it is specificly filtered out in https://github.com/One-com/assetgraph-builder/blob/master/bin/buildProduction#L165

If JavaScriptInclude was populated, wouldn't buildProduction be able to correctly bundle relations? I am thinking that even if you did a previous buildDevelopment and ran buildProductionon that output, https://github.com/One-com/assetgraph-builder/blob/master/bin/buildProduction#L186 would take care out the double reference and still be able to put the INCLUDEd assets in the right order.

I am here assuming non-usage of the i18n features which i am totally on board with not working in a dev environment without a dev build.

from assetgraph-builder.

papandreou avatar papandreou commented on September 26, 2024

Ah, I thought you were talking about one of your own use cases.

If JavaScriptInclude was populated, wouldn't buildProduction be able to correctly bundle relations? I am thinking that even if you did a previous buildDevelopment and ran buildProductionon that output

Well, in theory, yes, but I'm still not a fan, because I fail to see the use case for INCLUDE without buildDevelopment. Your project wouldn't work before it had been run through buildProduction, which would be a terrible workflow. And I really hope we're not trying to sell INCLUDE to new users?

https://github.com/One-com/assetgraph-builder/blob/master/bin/buildProduction#L186 would take care out the double reference and still be able to put the INCLUDEd assets in the right order.

No, mergeIdenticalAssets just makes sure that assets with the same MD5 become the same node in the graph, which they would already be because the INCLUDE and the <script src="..."> would be pointing at the same url. We would need additional transforms to weed out the duplicate <script src="..."> that would be introduced.

All in all I'm not convinced this is worth the extra complexity.

from assetgraph-builder.

Munter avatar Munter commented on September 26, 2024

I agree that we shouldn't try to market INCLUDE.

I think I might actually have confused myself with this issue. I'll close it and reopen if I remember what my original point was :D

from assetgraph-builder.

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.