Results 1 to 6 of 6

Thread: Fiddle sometimes needs a page refresh

  1. #1
    Sencha Premium User
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807
    Answers
    23

    Default Fiddle sometimes needs a page refresh

    Wondering why I see 2 console.logs in one run.

    https://fiddle.sencha.com/#view/editor&fiddle/1lc8

    Attachment 55563

  2. #2
    Sencha Premium User
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807
    Answers
    23

    Default

    Oh I got it, it's because I add the app.js in the index.html file. Weird, I think first time when adding js files Fiddle doesn't detect them, and it says that the namespaces is undefined, then I added all js files in the index.html and the error disappeared and I got the console logs. But then I saved refreshed the page and saw 2 console logs, one coming from Ext.onReady with embedded app.js code in it, and the other one coming from the app.js itself. So I removed app.js from index.html saved and refreshed the page and everything went ok.

    Seems that many weird things happen when working in 1 session and sometimes have to refresh the page and make Fiddle working. Wondering if anyone have had the same ?

  3. #3
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Quote Originally Posted by vadimv View Post
    Oh I got it, it's because I add the app.js in the index.html file. Weird, I think first time when adding js files Fiddle doesn't detect them, and it says that the namespaces is undefined, then I added all js files in the index.html and the error disappeared and I got the console logs.
    I want to understand this a bit more. So when you open fiddle and it has app.js and index.html files by default (btw, index.html is only <body></body> stuff), Fiddle will load app.js by default. This happens for me every time without needing to save or refresh the browser.

    Like local development, you have to require classes to load them when working with Ext JS. You are getting around that by loading them in your index.html which will work just not the way you do Ext JS development. 1 class per file and using requires in your classes is the prescribed way to develop with Ext JS.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #4
    Sencha Premium User
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807
    Answers
    23

    Default

    Quote Originally Posted by mitchellsimoens View Post
    Like local development, you have to require classes to load them when working with Ext JS. You are getting around that by loading them in your index.html which will work just not the way you do Ext JS development. 1 class per file and using requires in your classes is the prescribed way to develop with Ext JS.
    Ok, then this explains my problems. My first expectations were that Fiddle will add the JS files automatically, which actually does this but only when the folders and files structures corresponds to the ExtJS dev way. Thanks for your explanation.

  5. #5
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    This is one of the differences from Fiddle 2 to Fiddle 1.

    Fiddle 1 would take all your files and concatenate them and output them in an inline <script> in the index.html. This means no remote file loading, poorer debuging and seemingly random order of concatenation.

    Fiddle 2 is different, as you are experiencing, files are no longer concatenated and are now loading remotely mimicing local development (using requires). Fiddle 2 is trying to be as close to if you were working locally on an application.

    Fiddle 2 will still run fiddles created with Fiddle 1 in the Fiddle 1 way so it doesn't possibly break thousands of fiddles that relied on the concatenation. You can "upgrade" a Fiddle 1 fiddle to the Fiddle 2 way if you want to support the remote file loading and such but it's an optional step (for now).

    This was mentioned in this guide also: http://docs.sencha.com/fiddle/guides...ith_files.html

    I am currently writing a blog that will also further highlight this.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #6
    Sencha Premium User
    Join Date
    Sep 2010
    Location
    Cluj, Romania
    Posts
    807
    Answers
    23

    Default

    Quote Originally Posted by mitchellsimoens View Post
    This is one of the differences from Fiddle 2 to Fiddle 1.

    Fiddle 1 would take all your files and concatenate them and output them in an inline <script> in the index.html. This means no remote file loading, poorer debuging and seemingly random order of concatenation.
    Yes, that's why my confusion. And my bad that I didn't read the docs you just pointed out.

Similar Threads

  1. BUG: Fiddle is blank page in IE11 - Windows Phone 8.1 Update
    By alexander.urban in forum Sencha Fiddle
    Replies: 1
    Last Post: 11 Nov 2015, 4:51 AM
  2. Replies: 2
    Last Post: 12 Feb 2014, 12:51 PM
  3. Fiddle Idea: Customize How Fiddle is Inserted in Forum
    By existdissolve in forum Sencha Fiddle
    Replies: 3
    Last Post: 4 Aug 2013, 8:39 AM
  4. how to config page grid to request refresh page when a column is selected asc/desc
    By dgherrig in forum Sencha Architect 2.x: Help & Discussions
    Replies: 4
    Last Post: 19 Sep 2012, 4:15 PM
  5. Replies: 0
    Last Post: 21 May 2009, 7:06 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •