Skip to content

Commit

Permalink
Merge pull request #38374 from code-dot-org/remove-bramble-npm
Browse files Browse the repository at this point in the history
Remove @code-dot-org/bramble package, load bramble from S3 package
  • Loading branch information
Madelyn Kasula committed Jan 8, 2021
2 parents 310a226 + 215a73c commit 2a086cd
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 730 deletions.
7 changes: 0 additions & 7 deletions apps/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ describe('entry tests', () => {
src: ['**'],
dest: 'build/package/js/piskel/'
},
// Bramble must not be minified or digested in order to work properly.
{
expand: true,
cwd: './node_modules/@code-dot-org/bramble/dist',
src: ['**'],
dest: 'build/package/js/bramble/'
},
{
expand: true,
cwd: 'lib/droplet',
Expand Down
1 change: 0 additions & 1 deletion apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"@cdo/interpreted": "link:../dashboard/config/libraries",
"@code-dot-org/artist": "0.2.1",
"@code-dot-org/blockly": "3.5.32",
"@code-dot-org/bramble": "0.1.26",
"@code-dot-org/craft": "0.2.2",
"@code-dot-org/dance-party": "1.0.1",
"@code-dot-org/johnny-five": "0.11.1-cdo.2",
Expand Down
19 changes: 7 additions & 12 deletions apps/src/weblab/brambleHost.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
* JS to communicate between Bramble and Code Studio
*/

window.requirejs.config({
baseUrl: '/blockly/js/bramble/'
// DEVMODE: baseUrl: 'http://127.0.0.1:8000/src/'
});
const scriptData = document.querySelector('script[data-bramble]');
const brambleConfig = JSON.parse(scriptData.dataset.bramble);
const BRAMBLE_BASE_URL = brambleConfig.baseUrl;
window.requirejs.config({baseUrl: BRAMBLE_BASE_URL});

// This is needed to support jQuery binary downloads
import '../assetManagement/download';
Expand Down Expand Up @@ -596,10 +596,7 @@ function load(Bramble) {
bramble_ = Bramble;

Bramble.load('#bramble', {
url:
'//downloads.computinginthecore.org/bramble_0.1.26/index.html?disableExtensions=bramble-move-file',
// DEVMODE: INSECURE (local) url: "../blockly/js/bramble/index.html?disableExtensions=bramble-move-file",
// DEVMODE: INSECURE url: "http://127.0.0.1:8000/src/index.html?disableExtensions=bramble-move-file",
url: BRAMBLE_BASE_URL + '/index.html?disableExtensions=bramble-move-file',
useLocationSearch: true,
disableUIState: true,
initialUIState: {
Expand Down Expand Up @@ -820,7 +817,5 @@ function modalError(message, Bramble, showButtons = true) {
}

// Load bramble.js
requirejs(['bramble'], function(Bramble) {
// DEVMODE: requirejs(["bramble/client/main"], function (Bramble) {
load(Bramble);
});
const brambleClient = brambleConfig.devMode ? 'bramble/client/main' : 'bramble';
requirejs([brambleClient], load);

0 comments on commit 2a086cd

Please sign in to comment.