These are chat archives for canjs/canjs

21st
Nov 2016
xedos
@xedoken
Nov 21 2016 04:05
Chasen Le Hara
@chasenlehara
Nov 21 2016 06:35
Hey @xedoken, can you tell what is undefined? As in, what’s the variable name that is supposed to be an object with an extend function?
xedos
@xedoken
Nov 21 2016 06:36
yeah, error was in line with DefineMap.extend
i reinstall latest steal and steal-tools and check for global exporting
Chasen Le Hara
@chasenlehara
Nov 21 2016 06:38
Ah ok, so I’m guessing that the global script you’re exporting just has your code and doesn’t set a DefineMap variable.
I’m guessing you’ll want to include the can-map-define code like this: https://github.com/canjs/can-map-define#standalone-use
xedos
@xedoken
Nov 21 2016 06:50

i add script with can-map-define.js from dist folder and then add script with exported global script from app.

so now i got 2 errors.

first: can-map-define.js:133 Uncaught TypeError: Cannot set property 'define' of undefined(…)

second: avatar.js:126 Uncaught TypeError: Cannot read property 'extend' of undefined(…)

still not working(
if i build a bundle version of application, and then load in html as js file. it works perfect! :) . but when export as global, still got errors :(
Chasen Le Hara
@chasenlehara
Nov 21 2016 07:01
Hm, looks like the first one is because mapHelpers is undefined in can-map-define.js… because can-map is probably not included
I’m guessing you need to also add that global script, but before I send you down a rabbit hole, @justinbmeyer, @matthewp, or @phillipskevin might be able to give some better guidance tomorrow.
xedos
@xedoken
Nov 21 2016 07:14
yeah, if i include global can-map before can-map-define first error is gone, but second still exists. i will try smth else, thank you
xedos
@xedoken
Nov 21 2016 07:29

so, i try another solution, add latest can-define global script from dist and error dissapear, but now another error appear avatar.js:795 Uncaught TypeError: stache is not a function(…)

so i try add can-stache global script or can.all from dist with all deps, and error still exist. idk what to do, so may be later someone tell me correct steps to use global script. thank you :)

Jeroen Cornelissen
@jeroencornelissen
Nov 21 2016 12:58
Is it possible to set custom headers for a can-connect ajax request? We need a CSRF token in every request.
Something like this:
$.ajaxSetup({
    headers: {
        'X-CSRF-Token': $('meta[name="_token"]').attr('content')
    }
});
Szabolcs Schmidt
@sszabolcs
Nov 21 2016 13:17
Hi @justinbmeyer ! I would like to use canJS 3.0 with AMD module loading (requirejs) but there are no AMD compatible files in the node_modules/can/dist folder where they are supposed to be according to the docs. Am I missing something or it is not possible to use canJS 3.0 with AMD module loading?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 15:05
@xedoken importent info for your
can and done JS at present have overlapping modules
that means you should choose if you use canjs or donejs for your application
i guess as i pointed you to donejs pre you choosed donejs so canjs + steal right?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 15:13
and if you realy use the donejs app then you should
import CanMap from "can-map";
import "can-map-define";
import route from 'can-route';
import "can-route-pushstate";
import stache from "can-stache";
import 'can-stache/helpers/route';
thats the ground stack you can drop can route and route if you don't use the routing
xedos
@xedoken
Nov 21 2016 15:56
@frank-dspeed year, i choose donejs stack. create some basic components, export as a global script. now i need to import that global script with script tag in my other project. so i got an errors. if i build bundles export, and then add script tag with all deps in html file it works fine, but global fails.
Frank Lemanschik
@frank-dspeed
Nov 21 2016 15:57
ok thats exactly what i am working on and what i guessed :)
plz post your build.js
i am at present refining the process of integration :) so its ideal that we deal now with your current case
so i can address that also
xedos
@xedoken
Nov 21 2016 15:59
var stealTools = require("steal-tools");

stealTools.export({
  system: {
    main: "my-module",
    config: __dirname+"/package.json!npm"
  },
  outputs: {
    "+global-js": {},
    "+global-css": {}
  }
});
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:00
@sszabolcs you need to fork the git repo and create amd files your self with steal-tools but its planned i think that this gets soon added to dist also
xedos
@xedoken
Nov 21 2016 16:00
i tried steal/steal-tools 0.16 and 1.0 pre, both fail :(
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:00
yes
they are diffrent
you should use 1.0
stealjs/steal#875
then read all this
:D
as you see matt needs to write the guide for this at present :)
but i think you get it done importent is the part about including steal it self!
Kevin Phillips
@phillipskevin
Nov 21 2016 16:13
@sszabolcs here is the issue for adding AMD builds to the can distribution: canjs/canjs#2646
xedos
@xedoken
Nov 21 2016 16:22

@frank-dspeed now i use steal/steal-tools 1.0. change build js with 1.0 migration guide. export as a global, try include and old error is shown.

avatar-maker.js:126 Uncaught TypeError: Cannot read property 'extend' of undefined(…)

i think its about missing can-map..

am i need to include this deps:

import CanMap from "can-map";
import "can-map-define";
import route from 'can-route';
import "can-route-pushstate";
import stache from "can-stache";
import 'can-stache/helpers/route';

but as a global scripts before my global app script?

Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:44
right
your global app should simply do that what i posted
then steal-tools should bundle that all app
but listen does it work at present when you do development html with a webserver?
or how do you run your dev ?
Matthew Phillips
@matthewp
Nov 21 2016 16:48
@xedoken if you just one script tag you probably just want to use +standalone rather than +global-js
+global-js ignores dependencies, so you'd have to create a script tag for each canjs module
exporting an app to script is not really a great idea
it will probably be larger than you really want to run
So you're probably the first to try this, might run into some issues
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:50
he is by far not the first
all try to do that :) all whant to export the apps as individual apps and recombine them with other projects
i think its more the general case then creating a single one page app with it
for example there are many python users that manage templates and serverside rendering in python and then whant to integrate a canjs app into that
or people with big nodejs apps or php apps
php is still installed and used for millions of pages
Matthew Phillips
@matthewp
Nov 21 2016 16:54
you don't have to be building a single page app to use steal
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:54
thats right but it gets more hard if you have 2 donejs apps that you whant to export for usage on same page
Chasen Le Hara
@chasenlehara
Nov 21 2016 16:55
@xedoken, creating a DoneJS plugin might be more along the lines of what you want (versus an app). https://donejs.com/plugin.html
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:55
i think all problems come from the fact that steal is not multi loadable if that would be addressed
Mohamed Cherif Bouchelaghem
@cherifGsoul
Nov 21 2016 16:55
@chasenlehara +1 I tried it with PHP
Matthew Phillips
@matthewp
Nov 21 2016 16:55
2 donejs apps on the same page would indeed be hard
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:56
all could export bundels with steal and load the single js files
Matthew Phillips
@matthewp
Nov 21 2016 16:56
what do you mean by multi loadable?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:56
ya and that needs addressing thats why the people export
that what i discussed with you in the one issu
we add a global load array or object
and steal loads only once !
then it adds to the existing or new load object its dependencys
if missiong
missing :)
so we split the main steal into 2 objects 1 lists with dependencys to load and one loader that loads the list
Matthew Phillips
@matthewp
Nov 21 2016 16:57
i'm working on this sort of thing now actually
will post a link in a few
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:58
ok will watch into that because i think then its load able easy more then once without much trouble or refactoring
and then all can simply export with steal integrated and it will work
Kevin Phillips
@phillipskevin
Nov 21 2016 16:59
what’s the use case for having two donejs apps on one page?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:59
Kevin Combination
Kevin Phillips
@phillipskevin
Nov 21 2016 16:59
not sure what you mean
Frank Lemanschik
@frank-dspeed
Nov 21 2016 16:59
Example we got here one user that whants to build a cms with it he whants to create components and for example like widgeds
that are combine able to pages
Kevin Phillips
@phillipskevin
Nov 21 2016 17:00
yeah… I know of his example
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:00
its also my example my vision is to compose apps out of individual interfaces and apis fast
so that you can create for example a facebook instagram + db app in less then a day
including front and backend parts
thats why i also prepare apis for feathers for all big companys like google docker facebook
Kevin Phillips
@phillipskevin
Nov 21 2016 17:01
ok, I just don’t understand how steal export helps with this
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:01
steal exports helps not steal load would help :)
it would help that js files that include steal are loadable
without beaking the site
at present steal-tools export solves the problem that steal is loadable only once
Kevin Phillips
@phillipskevin
Nov 21 2016 17:02
why do you want to load steal twice?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:03
i whant to require bundels without re bundle them
Kevin Phillips
@phillipskevin
Nov 21 2016 17:03
why not just have one main script that steal loads… and then use System.import in your “component” scripts
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:03
and the bundels should run standalone
so both need to include steal
Kevin Phillips
@phillipskevin
Nov 21 2016 17:03
wouldn’t that make the page a lot bigger?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:04
it would simply make it more complicated to distribute
it would be nice to build a package lib later with ready to use stuff for coders
Mohamed Cherif Bouchelaghem
@cherifGsoul
Nov 21 2016 17:04
@frank-dspeed just bundle steal
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:05
The Final overall goal i think is to make App Full Development cycle more integrated fast and easy
@cherifGsoul thats right when i bundel steal with 2 projects ?
whats then ?
for example i have a big office application that has many sub projects a Invoice part
Core Data parts like Customers and all that
Justin Meyer
@justinbmeyer
Nov 21 2016 17:06
@jeroencornelissen you can use a $.ajaxSetup if you are using supermap ... or if you built your own connection and set .ajax on it to $.ajax
is that where it talks about AMD?
@sszabolcs I haven't finished the "Setting up CanJS" page
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:07
but now i whant to offer the invoice part also as free app that all can add
so every one that whants to code a app where he needs to create invoices with pdf and that
he should be able to npm install integrate
Justin Meyer
@justinbmeyer
Nov 21 2016 17:08
@sszabolcs AMD support wasn't planned to be added. Mostly b/c we want people going straight to the NPM modules.
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:08
as also simply include it via script tag
I whant to be able to compose for example whole office and crm applications out of donejs frontends and feathers backends :)
thats the mission
Kevin Phillips
@phillipskevin
Nov 21 2016 17:10
and have each “donejs frontend” loaded with a script tag
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:10
yes
Justin Meyer
@justinbmeyer
Nov 21 2016 17:10
@sszabolcs https://github.com/canjs/canjs/blob/master/build.js#L15 is what writes out the dist files.
I'll accept a pull request to make an "AMD" format. I think you'll need to use eachModules
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:15
@phillipskevin did you do apps with plugins? what happens in that case?
i at present did always individual apps with components
Kevin Phillips
@phillipskevin
Nov 21 2016 17:15
donejs plugins you mean?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:16
yes sure exactly
are plugins export able and combine able some how in a easy way?
Kevin Phillips
@phillipskevin
Nov 21 2016 17:16
donejs plugins get published to npm
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:16
by export i don't mean a diffrent formart more a production build thats use able
Kevin Phillips
@phillipskevin
Nov 21 2016 17:16
then you install them with npm when you want to use in another app
and include it in your apps build just like any other dependency
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:17
so i understood right that plugin is simply without steal
because steal is in the main DoneJS App
Kevin Phillips
@phillipskevin
Nov 21 2016 17:17
it’s set up to create a global, and, and commonjs version
so you can use it globally
that’s an example
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:20
what files does it create
it creates a single JS?
Kevin Phillips
@phillipskevin
Nov 21 2016 17:21
the global build, yeah
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:21
and that renders and all?
if that works that could be the solution :)
then we only need to make the guids fit to force coding plugins
Kevin Phillips
@phillipskevin
Nov 21 2016 17:22
this is a guide for coding plugins
making a plugin doesn’t make sense for everything though
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:22
yes true but as you see App is confusing now a bit in some cases
because a plugin is then a app also
but then its reuseable
Kevin Phillips
@phillipskevin
Nov 21 2016 17:23
that’s why we’re here to answer questions :smile:
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:23
and there are a lot of big application parts that get repeated all over
from google maps integration
till facebook stuff till stats
user managment
Kevin Phillips
@phillipskevin
Nov 21 2016 17:23
yeah, those would be great as plugins
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:24
ya all that stuff that gets always used all over on all apps
every app needs user auth and so on
if we get all that compose able and finish the ATOM IDE I planned
then we are near to the goal of coding individuall apps in some hours :)
Including production deployment
i am composing a DoneJS Atom ide that will then be able to run the yeoman generators and all that out of the ide
Kevin Phillips
@phillipskevin
Nov 21 2016 17:25
good, I’m glad you have big dreams
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:26
then there is less switching
look this animation :)
its a dream to create donejs projects with feathers and that then
in some minuts you have setuped apis all
will do video trainings about that then
you get free invite ;)
Kevin Phillips
@phillipskevin
Nov 21 2016 17:28
thanks :+1:
Nico R.
@nriesco
Nov 21 2016 17:33
Are donejs plugins compatible with canjs?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:34
@nriesco yes they should be the only problem i see is the loading via steal
so you would need to integrate steal into your canjs project
Kevin Phillips
@phillipskevin
Nov 21 2016 17:34
why would that be a problem?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:34
because it could lead to complex scenarios
he could for example already have loaded canjs 2.3 and then steal loads canjs3
as also diffrent jquery versions
and as far as i know overwrites also existing global objects
:D
Nico R.
@nriesco
Nov 21 2016 17:35
How do I include a plugin then? In donejs it's pretty straight forward
Kevin Phillips
@phillipskevin
Nov 21 2016 17:35
ok
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:36
@nriesco yes as long as the donejs version matches
if you’re using npm, you can just npm install it
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:37
@nriesco but upgrading all plugins to canjs3 will be a major thing to do anyway
and after that i think we get all versions consistent so that plugins can be versioned too
so we get a donejs3 donejs2 plugin version
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:42
where should we create the issu for the global donejs plugin repository and site?
who should host it :)
We Need a Global Place like npm and atom for all donejs plugins
and we need the donejs package manager
Kevin Phillips
@phillipskevin
Nov 21 2016 17:45
there is one already: donejs/donejs#682
Frank Lemanschik
@frank-dspeed
Nov 21 2016 17:59
Its a dream
we progress well don't tought that this day so much issus can be closed :)
i am amazed need to finish the donejs-library :D and add all generators and plugins
Matthew Phillips
@matthewp
Nov 21 2016 18:22
@frank-dspeed and others, stealjs/rfcs#5
Frank Lemanschik
@frank-dspeed
Nov 21 2016 19:20
looks good to me
now we need only to version donejs right
so that we attach or integrate some how the CanJS Version it belongs to and maybe steal version some how because all 3 need match
I am so happy that all this got done today :)
now steal can get a successor over systemjs soon
the big plan is that feathers makes all backend stuff steal does the loading we should also create a backend steal for make loading of large projects more easyer with a installIfMissing Method
Frank Lemanschik
@frank-dspeed
Nov 21 2016 19:51
@matthewp what about dedublication ? when we then got bundels from lets say 50 plugins
imagine the case that we wanna load 50 donejs-plugins via steal each is using jquery 3.1 or any dependency like can-stache
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:02
I think the full path can be a key to do dedublication so we can match same dependencys if they are loaded already via steal or not
also we could find fails like double loaded dependencys with diffrent versions
Justin Meyer
@justinbmeyer
Nov 21 2016 20:20
steal already handles de-duplication assuming you import the same version of things
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:20
Justin yes but it handels that on Project level
that means if we think about 50 git repos all are indipendent donejs-plugins
and we require the dist bundels of them
so the 50 are all dependencys of a external app written in python only loading the steal loader via script tag
and each of that 50 got overlapping dependencys and all 50 are already de dublicated because they are bundeled already
Justin Meyer
@justinbmeyer
Nov 21 2016 20:22
I don't understand how this is related to the rfcs @matthewp posted
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:22
the Relation is that his rfc enables loading of bundels
this bundels could be produces indidependent
excuse me produced indipendent so they are all including overlapping dependencys and get loaded via the same loader
Justin Meyer
@justinbmeyer
Nov 21 2016 20:23
yeah, but they shouldn't be
that would be a mistake ... one app should only load the builds produced by one build
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:24
ya i know your concepts suggests to require the plugins in a donejs project and then bundel to a single project
but i think it would be greate to archive usage outside of donejs on big php cms systems like wordpress and that
Justin Meyer
@justinbmeyer
Nov 21 2016 20:25
I don't know what that would look like where you still wouldn't want one build per page
or to use the multi-build (which is one build command for many pages)
or if someone really wanted to do that ... they could use stealTools.export
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:26
ok easy going imagin a wordpress driven site
ya right steal-export at present is the workaround to do that
and then combine the scripts indipendent server side
but i think it would be greate to integrate that to steal also
i mean look systemjs does all that already
Justin Meyer
@justinbmeyer
Nov 21 2016 20:28
does what?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:28
build reuseable components
Justin Meyer
@justinbmeyer
Nov 21 2016 20:28
what do you mean by reusable?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:28
they call it sfx build
that means for example imagin a calendar
i could use it in my application at many places
imagin lists of some stuff
i could use the same calendar in my todo planing as inside my financial planing as for my admin tasks
Mohamed Cherif Bouchelaghem
@cherifGsoul
Nov 21 2016 20:30
@frank-dspeed donejs plugin is to way to go
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:30
Mohamed Cherif Bouchelaghem
@cherifGsoul
Nov 21 2016 20:30
and export the widget dont build
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:30
look at that this is a example project
Justin Meyer
@justinbmeyer
Nov 21 2016 20:31
ok ... I'm imagining all of this
what do you want?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:31
i whant to reuse them on many places :) without reloading them if not needed
Justin Meyer
@justinbmeyer
Nov 21 2016 20:31
reloading?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:31
right
i would love to avoice requests and cache hits
Justin Meyer
@justinbmeyer
Nov 21 2016 20:32
of course ... but I don't know what you mean still
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:32
maybe this all gets only clear if you see a bigger example
Justin Meyer
@justinbmeyer
Nov 21 2016 20:32
do you mean you want to build your calendar without it's dependencies? or as a standalone CJS or AMD build
b/c you already can do that with stealTools.export and the guide @cherifGsoul mentioned shows exactly this
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:33
not only the calendar the final goal is to make distribute able donejs-plugins
that can be used and loaded in diffrent projects
Justin Meyer
@justinbmeyer
Nov 21 2016 20:33
this is exactly what the guide @cherifGsoul talked about does
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:34
Mybe it realy does that i will simply try it out :) but as i did it in mind i found out that it should give a lot of unneed requests
we will see it
Justin Meyer
@justinbmeyer
Nov 21 2016 20:35
but as i did it in mind i found out that it should
what do you mean there?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:36
i was simply thinking about the loading flow so i was thinking about what happens if 1x html load 1x steal loader and then we load 50 plugin bundels that contain doublicated dependencys like can route can stache can anything or jquery
Justin Meyer
@justinbmeyer
Nov 21 2016 20:36
the builds it makes do not include the package.json's dependencies
Mohamed Cherif Bouchelaghem
@cherifGsoul
Nov 21 2016 20:36
@frank-dspeed do you mean multi-page use?
Justin Meyer
@justinbmeyer
Nov 21 2016 20:36
@frank-dspeed look at bit-tabs
it does not include can-stache in its global export
it only includes what's directly in bit-tabs
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:37
ya so i can't load bit tabs
thats the blocking point
i would love to get a bit-tabs js that loads anywhere
Justin Meyer
@justinbmeyer
Nov 21 2016 20:37
if you get a bit-tabs that loads anywhere
then you have the duplication problem
you can't have it both ways
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:38
but i whant a page where i whant to integrate 5 diffrent bit-tabs examples
Justin Meyer
@justinbmeyer
Nov 21 2016 20:38
what do you mean by "loads anywhere"
?
b/c you can load bit-tabs anywhere
you just have to make sure canjs is loaded too
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:39
for example directly in a wordpress post
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:39
yes and i whant to integrate some how the canjs dependency
i whant a loader that loads that for me :)
and only once
Justin Meyer
@justinbmeyer
Nov 21 2016 20:40
then you need to use the AMD build, or the CJS build
and then that works
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:40
nope my current way is using canjs + systemjs
its realy cool
then i do systemjs sfx builds
Justin Meyer
@justinbmeyer
Nov 21 2016 20:40
then you need to configure systemjs correctly
and it should work
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:40
it works
but i think steal should support that too!
Justin Meyer
@justinbmeyer
Nov 21 2016 20:40
ok, so then what's the problem?
support what!!!
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:41
to build web components load able via a single tag
Justin Meyer
@justinbmeyer
Nov 21 2016 20:41
bit-tabs supports loading from any loader
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:41
without extra dependency headache
Justin Meyer
@justinbmeyer
Nov 21 2016 20:41
single tag?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:41
single html script tag
Mohamed Cherif Bouchelaghem
@cherifGsoul
Nov 21 2016 20:41
@frank-dspeed wihtout stache?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:41
with the stache in it
Justin Meyer
@justinbmeyer
Nov 21 2016 20:41
your phrasing seems contradictory?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:42
all complet
Justin Meyer
@justinbmeyer
Nov 21 2016 20:42
if you want stache in it .. then change the one line of the build to include all deps
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:42
right that it should include all deps! and then the loader needs to de dublicate that deps
:D
there you got what it has to do with the rfc
now we load 2 bundels with all deps
Justin Meyer
@justinbmeyer
Nov 21 2016 20:43
it doesn't de-duplicate
no loader does
Kevin Phillips
@phillipskevin
Nov 21 2016 20:43
@frank-dspeed why not just use steal to bundle the can-* dependencies and then use System.import to import the components like bit-tabs
Justin Meyer
@justinbmeyer
Nov 21 2016 20:43
it just doesn't execute
modules that would be written out twice
I think steal currently does this
so would any loader
(steal currently does this if loading a bundle in the AMD format)
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:44
we will simply wait till i tested all this cases in real life
Justin Meyer
@justinbmeyer
Nov 21 2016 20:44
I'm still not really sure what you are saying
(also this is the wrong place ... this should be in steal's room)
are you saying that the "loader" just prevents re-execution of duplicated modules?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:45
:) damn my english is probally realy bad ok i will produce some donejs plugins and try to get them into a easy integrate able state for template coders
then we will see what happens
Justin Meyer
@justinbmeyer
Nov 21 2016 20:46
I think you should use concrete examples
I'll try
say I produced bit-tabs.js that included jquery and bit-cal.js that also included jquery
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:46
thats what i say i will prepare examples
at present there isn't anything maybe your right and all is solved already that would be the best possible case
Justin Meyer
@justinbmeyer
Nov 21 2016 20:47
// bit-tabs.js
define("jquery", function(){
  // jquery code
})
define("bit-tabs",["jquery"], function(){
  // bit-tabs code
})
// bit-cal.js
define("jquery", function(){
  // jquery code
})
define("bit-cal",["jquery"], function(){
  // bit-cal code
})
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:47
right that
Justin Meyer
@justinbmeyer
Nov 21 2016 20:48
cc @matthewp
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:48
what will steal do there
Justin Meyer
@justinbmeyer
Nov 21 2016 20:48
I presume that it will ignore the 2nd definition of jquery
it will of course load into the client
which is a MUCH bigger problem then the re-execution of jQuery
generally speaking, it takes longer to load code than execute it
I'm not sure if the bundles config can be written so jquery is in two spots. @matthewp ?
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:51
i think we could simply don't add it to the loader object if it exists as you sayed drop it
Justin Meyer
@justinbmeyer
Nov 21 2016 20:51
yes, that is what I think will happen
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:51
the steal loader should create
```
{ loader: {
"path/file": result
Justin Meyer
@justinbmeyer
Nov 21 2016 20:52
imo, the more interesting question here ... is could stealTools handle loading pre-built bundles like this and sort of "tree shake" what is and isn't used.
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:52
so we see if path file is in result and path file should be the resolve path
Justin Meyer
@justinbmeyer
Nov 21 2016 20:52
?
I don't know what you mean
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:52
at present steal bundle exports a numbered object Array
if it would export the real file path we could dedublicated that
Justin Meyer
@justinbmeyer
Nov 21 2016 20:54
I'm still not sure what you mean ... the steal.bundle really doesn't relate to this problem
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:54
so if we do in code require('jquery') we get node_modules/jquery
Justin Meyer
@justinbmeyer
Nov 21 2016 20:54
it's steal's internal registry of modules
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:54
if thats already there we simply can drop it
Justin Meyer
@justinbmeyer
Nov 21 2016 20:54
I don't think that is how it will/should work
it should just look at the internal registry when trying to define a module
if the module has already been defined, ignore the new definition
that way it doesn't matter where things load from
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:55
but a module can be app#jquery
so we get app1#jquery app2#jquery
Justin Meyer
@justinbmeyer
Nov 21 2016 20:55
there's nothing that can be done about that
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:55
but they are the same :)
Justin Meyer
@justinbmeyer
Nov 21 2016 20:56
the bundle was exported incorrectly
if those are the module names
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:56
perfect
then we got that :)
Justin Meyer
@justinbmeyer
Nov 21 2016 20:56
// bit-tabs.js
define("bit-tabs#jquery", function(){
  // jquery code
})
define("bit-tabs",["jquery"], function(){
  // bit-tabs code
})
if that was what bit-tabs.js looked like, people should re-write their config
b/c they probably had map: {jquery: "bit-tabs/jquery"}
instead of
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:58
ya i think also this is then more related to documentation and generators then the core code
Justin Meyer
@justinbmeyer
Nov 21 2016 20:58
paths: {jquery: "bit-tabs/jquery"}
yes, understanding the difference between module reference, module name, and module address is very important
Frank Lemanschik
@frank-dspeed
Nov 21 2016 20:59
i aggree fully
but overall that totall cool so we are more near to the goal of making app composing possible :)
that could replace app coding
Justin Meyer
@justinbmeyer
Nov 21 2016 21:00
yes, this is exactly what bit-tabs sets up
Frank Lemanschik
@frank-dspeed
Nov 21 2016 21:01
thats exactly what all coding agencys need to compite with the asian low price market
if they can simply get faster to market in less dev time they can reduce prices
Justin Meyer
@justinbmeyer
Nov 21 2016 21:01
however, it doesn't include the dependencies in the <script> export by default
Frank Lemanschik
@frank-dspeed
Nov 21 2016 21:01
and so maybe even new once can create apps like with app composers for iphone xanmarin and all that
Justin Meyer
@justinbmeyer
Nov 21 2016 21:01
mostly because if people are using <script> tags ... they tend to be creating their own dependency graph
Frank Lemanschik
@frank-dspeed
Nov 21 2016 21:02
ya but we should supply a method to show what the dependencys are
so that some one can easy integrate them i think there is a issue already for that
Justin Meyer
@justinbmeyer
Nov 21 2016 21:02
the dependencies are package.json's dependencies
in something like rail-asset pipeline
you have configuration like
bit-cal: canjs
bit-tabs: canjs
canjs: jquery
so if bit-cal is needed on a page, it will write out script tags for canjs and jquery
I'm sorta surprised if wordpress doesn't already have something similar
Frank Lemanschik
@frank-dspeed
Nov 21 2016 21:04
hmmm good idea
i hate wordpress
but its a big market
millions using it
Justin Meyer
@justinbmeyer
Nov 21 2016 21:04
my point is that most systems already allow you to configure your <script> dependencies in a similar way
Frank Lemanschik
@frank-dspeed
Nov 21 2016 21:04
excuse they abuse it not use it lol
Justin Meyer
@justinbmeyer
Nov 21 2016 21:05
if that is the case, then it's good to not include the dependencies in the build
Frank Lemanschik
@frank-dspeed
Nov 21 2016 21:05
i will look into that maybe your right and that should get solved via a wordpress plugin for example or joomla plugin that does the loading
and then something like done-serve does for the nodejs community
Justin Meyer
@justinbmeyer
Nov 21 2016 21:06
bit-cal: canjs //widgets.com/bit-cal.js
bit-tabs: canjs //widgets.com/bit-tabs.js
canjs: jquery  //canjs.com/release/can.js
jquery: //cdn.com/jquery/dist/jquery.js
(typically the configuration includes where to find the script)
Frank Lemanschik
@frank-dspeed
Nov 21 2016 21:07
ya i understand it looks clean :)
ok i see thats a configuration task 100%
and should get handled by a generator
not steal
thx a lot i will report my results back as soon as i got some so much changed today :D