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

Pulling customized stable release #445

Closed
smurali31 opened this issue Jul 28, 2014 · 24 comments
Closed

Pulling customized stable release #445

smurali31 opened this issue Jul 28, 2014 · 24 comments

Comments

@smurali31
Copy link

Hi - The website's customize page let's me download only certain components that I am interested in. However, the downloaded files seem to be missing some variables causing the app to crash.

Has anyone used this? FWIW, i tried doing "all" from the customize page and even that is not loadable

@frankhuiskamp
Copy link

I'm experiencing the same problems. I noticed SugarJS is trying to:
extend(date, ...) instead of extend(Date, ...)
and the same goes for array instead of Array.

@smurali31
Copy link
Author

Its missing common.js. Common.js is the file that contains definitions for date, array etc

@andrewplummer
Copy link
Owner

Sorry, this may have been due to a server infrastructure change that hosed me recently.
That said I can't repro this ... customized scripts are loadable for me.

Do you have an exact repro?

FYI the date vs. Date etc is just some compiler optimizations so that's intended.

Also common.js is only relevant to v1.5.0 which isn't released yet, so that shouldn't be an issue either.

@smurali31
Copy link
Author

yes, over here http://sugarjs.com/customize, try pulling core and date and load it in a simple web app.

For instance, if your pulled source is named sugar.js

<script src="sugar.js"> document.writeln(Date.create("2010-10-10")); </script>

when you load it you will see
"Uncaught ReferenceError: date is not defined"

It will be great if you can fix it asap

@andrewplummer
Copy link
Owner

Hm... no this is working ok for me as well...
I guess maybe you could clear your cache...?? Although I don't know how that would affect anything...

@smurali31
Copy link
Author

sugar.js/download seems to work just fine. Its only when i customize that its broken. I have tried it in both IE and Chrome on two different machines (after clearing caches).

The fact that another user hit the issue means there is something wrong IMO.

Here are the steps:

  1. http://sugarjs.com/customize
  2. Click on core
  3. Click on date
  4. Select min/dev.
  5. Click build
  6. If you selected min, you will see "y" is not defined. If you selected dev, you will see "date" is undefined.

@andrewplummer
Copy link
Owner

There definitely could be something wrong, but I just can't repro it...
Did exactly those steps, but mine runs fine. Tried both min/dev and tested out a few methods like Date.create. All in Chrome so far but no load errors whatsoever....

@frankhuiskamp Do you also have a similar repro?

@andrewplummer
Copy link
Owner

@smurali31 Also maybe can you link or make public the page using the customized build?

@smurali31
Copy link
Author

sure. i will link it.

can you share min and dev of core+date+date locales? I want to start using it in my project as soon as possible?

@smurali31
Copy link
Author

@andrewplummer
Copy link
Owner

You can actually do a custom build from within the repo. Basically it's just script/create_build.rb --packages=core,date,locales Have a look at the README for more. Also make sure you're checked out to the 1.4.1 tag.

Also that link is throwing a 500 load error for me... let me try to set something up.

@smurali31
Copy link
Author

@andrewplummer
Copy link
Owner

Here's my example: https://dl.dropboxusercontent.com/u/2389611/Experiments/Sugar/index.html

Already I see an issue with the Date locales not being included, but otherwise working correctly.

@andrewplummer
Copy link
Owner

Still get the 500 but not sure if it's related... also I just see a file directory and clicking on the html only shows the source.

@smurali31
Copy link
Author

you should also see a sugar.js file. This is the file I got when i customized build.

@smurali31
Copy link
Author

btw, when i checked out tag 1.4.1, i dont see a create_build.rb file under script. Was this file added in a newer release? All i see is analyzer.rb, build_pluigins.rb, compile.rb, create_release.rb, docs.rb, generate_docs.rb and size.rb.

@andrewplummer
Copy link
Owner

Sorry it should be create_release.rb

@smurali31
Copy link
Author

Extremely new to ruby...
here is what i am trying to do but to no avail.

Downloads\Sugar-1.4.1\Sugar-1.4.1>ruby script\create_release.rb core
The syntax of the command is incorrect.
The syntax of the command is incorrect.
The syntax of the command is incorrect.
script/create_release.rb:49:in ``': No such file or directory - cat lib/locales/

  • (Errno::ENOENT)
    from script/create_release.rb:49:in get_content' from script/create_release.rb:41:inblock (2 levels) in concat'
    from script/create_release.rb:40:in each' from script/create_release.rb:40:inblock in concat'
    from script/create_release.rb:39:in open' from script/create_release.rb:39:inconcat'
    from script/create_release.rb:120:in `'

I tried Downloads\Sugar-1.4.1\Sugar-1.4.1>ruby script\create_release.rb --packages core
as well. Same results..

@smurali31
Copy link
Author

I mean Downloads\Sugar-1.4.1\Sugar-1.4.1>ruby script\create_release.rb --packages=core

@andrewplummer
Copy link
Owner

Ok I think I see the issue. I think the precompiled files might be mixed up on the new server... So I need to update the files.

Meanwhile I've always been using the save command to save the custom-built code, but this does another GET request and simply gets the default package. This may have changed recently or it may be my mistake... not sure. I'm assuming that you've been copy/pasting the code instead? Anyway this explains the discrepancy in our results.

It looks like you're on a Windows system, so create_release.rb may not work (it's using unix commands).

For now here are the precompiled files for v1.4.1 until I update:

https://dl.dropboxusercontent.com/u/2389611/Experiments/Sugar/precompiled.zip

Just wrap them in a closure and you should be good to go.
I'll get the custom page fixed asap (moving everything to new architecture is the reason for this).

Thanks~

@smurali31
Copy link
Author

Awesome. Thanks so much for your help with this. Works now.

Could you please fix the custom page soon? It would be easier to point team mates to the site to pull the bits from there...

Also please update this thread so we can start pulling from the custom page.

Again, thanks for the extremely quick turnaround on this. Much appreciated.

Thanks

@andrewplummer
Copy link
Owner

Yup will update asap!

@andrewplummer
Copy link
Owner

Ok the customize page should be fixed now... please check it! Thank you.

@smurali31
Copy link
Author

Awesome. Works great..thanks a lot

closing

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

No branches or pull requests

3 participants