-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
TypeScript unhappy with 'blockly/javascript' exports #7283
Comments
Yes: the I think this slipped my mind because the intention was (and remains) to get these fully converted to TypeScript and actually generate the (Aside: same for library blocks, where I think we may be overwriting the generated |
Remove the protected declaration on provideFunction_ and FUNCITON_NAME_PLACEHOLDER_ so they can be used from generator functions written in TypeScript. Not strictly part of google#7283, but closely related and required to fixing the related issue google/blockly-samples#1785.
…t compatibility (#7295) * fix(generators): Add missing declarations for Order enums * chore(generators): Remove spurious whitespace * fix(generators): Make provideFunction_ etc. public Remove the protected declaration on provideFunction_ and FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator functions written in TypeScript. Not strictly part of #7283, but closely related and required to fixing the related issue google/blockly-samples#1785. * chore(generators): format
…t compatibility (#7295) * fix(generators): Add missing declarations for Order enums * chore(generators): Remove spurious whitespace * fix(generators): Make provideFunction_ etc. public Remove the protected declaration on provideFunction_ and FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator functions written in TypeScript. Not strictly part of #7283, but closely related and required to fixing the related issue google/blockly-samples#1785. * chore(generators): format (cherry picked from commit d503fbb)
* fix(generators): Changes to exports and access controls for TypeScript compatibility (#7295) * fix(generators): Add missing declarations for Order enums * chore(generators): Remove spurious whitespace * fix(generators): Make provideFunction_ etc. public Remove the protected declaration on provideFunction_ and FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator functions written in TypeScript. Not strictly part of #7283, but closely related and required to fixing the related issue google/blockly-samples#1785. * chore(generators): format (cherry picked from commit d503fbb) * fix: Correct errors in `HSV_SATURATION`, `HSV_VALUE` accessors (#7297) * fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors Fix the comment / message errors noted in #7249 (comment) * chore: Add renamings for HSV_SATURATION, HSV_VALUE (cherry picked from commit 1bc4f67) * release: Update version number to 10.0.2 --------- Co-authored-by: Christopher Allen <cpcallen+git@google.com>
* fix(generators): Changes to exports and access controls for TypeScript compatibility (#7295) * fix(generators): Add missing declarations for Order enums * chore(generators): Remove spurious whitespace * fix(generators): Make provideFunction_ etc. public Remove the protected declaration on provideFunction_ and FUNCTION_NAME_PLACEHOLDER_ so they can be used from generator functions written in TypeScript. Not strictly part of #7283, but closely related and required to fixing the related issue google/blockly-samples#1785. * chore(generators): format (cherry picked from commit d503fbb) * fix: Correct errors in `HSV_SATURATION`, `HSV_VALUE` accessors (#7297) * fix: Correct errors in HSV_SATURATION, HSV_VALUE accessors Fix the comment / message errors noted in #7249 (comment) * chore: Add renamings for HSV_SATURATION, HSV_VALUE (cherry picked from commit 1bc4f67) * release: Update version number to 10.0.2 --------- Co-authored-by: Christopher Allen <cpcallen+git@google.com>
I'm still unable to import the import { javascriptGenerator, Order } from "blockly/javascript";
^
SyntaxError: The requested module 'blockly/javascript' does not provide an export named 'Order' Workaround: import JavaScript from "blockly/javascript";
const { javascriptGenerator, Order } = JavaScript; |
TL;DR
Fails to compile without
// @ts-ignore
flagTemporary fix
Adding
// @ts-ignore
comment will allow it to compile and run without any noted errorsDetails
Didn't have time to look too deeply into the issue, but this is what I've dug up from a cursory look:
Looks like
Order
is not being exported in thejavascript.d.ts
file - https://github.com/google/blockly/blob/blockly-v10.0.1/typings/javascript.d.tsMight be because typescript does not like the
export * from ...
syntax in originaljavascript.js
source - https://github.com/google/blockly/blob/blockly-v10.0.1/generators/javascript.jsThe text was updated successfully, but these errors were encountered: