Sample app ts seems broken

67 views
Skip to first unread message

Seb Seb

unread,
Jul 16, 2023, 7:51:27 PM7/16/23
to Blockly
Hi,
I've just clone blockly-samples repo, and tested blockly-samples\examples\sample-app-ts but when launching it breaks on:
ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-app-ts\s
rc\index.ts
./src/index.ts 43:23-54
[tsl] ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-ap
p-ts\src\index.ts(43,24)
      TS2345: Argument of type '(e: Blockly.Events.UiBase) => void' is not assig
nable to parameter of type '(e: Abstract) => void'.
  Types of parameters 'e' and 'e' are incompatible.
    Type 'Abstract' is not assignable to type 'UiBase'.
      Types of property 'workspaceId' are incompatible.
        Type 'string | undefined' is not assignable to type 'string'.
          Type 'undefined' is not assignable to type 'string'.

ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-app-ts\s
rc\index.ts
./src/index.ts 52:23-54
[tsl] ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-ap
p-ts\src\index.ts(52,24)
      TS2345: Argument of type '(e: Blockly.Events.UiBase) => void' is not assig
nable to parameter of type '(e: Abstract) => void'.
  Types of parameters 'e' and 'e' are incompatible.
    Type 'Abstract' is not assignable to type 'UiBase'.

ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-app-ts\s
rc\generators\javascript.ts
./src/generators/javascript.ts 7:8-13
[tsl] ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-ap
p-ts\src\generators\javascript.ts(7,9)
      TS2305: Module '"blockly/javascript"' has no exported member 'Order'.
 @ ./src/index.ts 9:0-52 16:35-44

ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-app-ts\s
rc\generators\javascript.ts
./src/generators/javascript.ts 21:28-44
[tsl] ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-ap
p-ts\src\generators\javascript.ts(21,29)
      TS2445: Property 'provideFunction_' is protected and only accessible withi
n class 'CodeGenerator' and its subclasses.
 @ ./src/index.ts 9:0-52 16:35-44

ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-app-ts\s
rc\generators\javascript.ts
./src/generators/javascript.ts 23:31-57
[tsl] ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-ap
p-ts\src\generators\javascript.ts(23,32)
      TS2445: Property 'FUNCTION_NAME_PLACEHOLDER_' is protected and only access
ible within class 'CodeGenerator' and its subclasses.
 @ ./src/index.ts 9:0-52 16:35-44

Thanks to help resolve it.

Christopher Allen

unread,
Jul 17, 2023, 8:34:56 AM7/17/23
to blo...@googlegroups.com
Hi Seb,

On Mon, 17 Jul 2023 at 01:51, Seb Seb <prt...@gmail.com> wrote:
I've just clone blockly-samples repo, and tested blockly-samples\examples\sample-app-ts but when launching it breaks on…

Thanks for this bug report.  I've filed issue #1785 in the blockly-samples repository to track it.

This particular error:

ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-app-ts\s
rc\generators\javascript.ts
./src/generators/javascript.ts 7:8-13
[tsl] ERROR in F:\Logiciels\Arduino_graphique\blockly-samples\examples\sample-ap
p-ts\src\generators\javascript.ts(7,9)
      TS2305: Module '"blockly/javascript"' has no exported member 'Order'.
 @ ./src/index.ts 9:0-52 16:35-44

is due to google/blockly#7283 for which I have a fix pending—I was just looking to see if we had an example in blockly-samples that I could use as a test case for the fix, and indeed it turns out that we do!

The other errors will require further investigation.


Christopher

Seb Seb

unread,
Jul 19, 2023, 6:31:26 AM7/19/23
to Blockly
Hi,
now it works with Blockly 10.0.0.2
Many thanks.

Seb Seb

unread,
Jul 25, 2023, 11:26:44 AM7/25/23
to Blockly
Hi,
there's still a problem: it does not tanslate toolbox.
In index.ts, if I simply add translation, only blocks are translated and not toolbox:
import * as fr from 'blockly/msg/fr';
Blockly.setLocale(fr);
const ws = blocklyDiv && Blockly.inject(blocklyDiv, {toolbox});
Does anybody as same translation problem ith toolbox?

Maribeth Moffatt

unread,
Jul 25, 2023, 2:36:09 PM7/25/23
to Blockly
Hello,

If you take a look at the toolbox file in the sample app, you'll see the names for the categories are hardcoded in the toolbox definition. If you want them to be translated, you'll have to add your own translations for the category names (we don't provide translations for them out of the box, you'll see in the code demo in core that they are provided separately in that demo) and then reference them using `Blockly.Msg.LOGIC_CATEGORY_NAME_YOU_PROVIDED` instead of the hard-coded string `Logic`.

Maribeth

Seb Seb

unread,
Jul 25, 2023, 2:48:43 PM7/25/23
to Blockly
Thanks, sorry I misunderstood the way it works. Well I still have a lot of work...
Reply all
Reply to author
Forward
0 new messages