Skip to content

Block versioning #4

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/engine/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const BlocksRuntimeCache = require('./blocks-runtime-cache');
const log = require('../util/log');
const Variable = require('./variable');
const getMonitorIdForBlockWithArgs = require('../util/get-monitor-id');
const ScratchBlocks = require('scratch-blocks');

/**
* @fileoverview
Expand Down Expand Up @@ -554,6 +555,13 @@ class Blocks {
// A new block was actually added to the block container,
// emit a project changed event
this.emitProjectChanged();

const scratchBlock = ScratchBlocks.getMainWorkspace().getBlockById(block.id);
if (scratchBlock) {
const blockSvg = scratchBlock.getSvgRoot()
blockSvg.setAttribute('data-opcode', block.opcode);
}

}

/**
Expand Down
5 changes: 5 additions & 0 deletions src/extension-support/extension-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,11 @@ class ExtensionManager {

// avoid promise latency if we can call direct
const serviceObject = dispatch.services[serviceName];
// var newFunc = funcName
// if (funcName.includes("_v")) {
// newFunc = `internal_${funcName}`;
// }

if (!serviceObject[funcName]) {
// The function might show up later as a dynamic property of the service object
log.warn(`Could not find extension block function called ${funcName}`);
Expand Down
Loading