SageCell Vue Component

20 views
Skip to first unread message

Ingo Dahn

unread,
Nov 2, 2020, 4:13:34 PM11/2/20
to sage-cell
Has someone perhaps built a Vue component with a SageCell?

Ingo Dahn

unread,
Nov 2, 2020, 4:32:22 PM11/2/20
to sage-cell
Got it; it is working when embedded_sagecell.js is loaded in head of main.html.

Ingo Dahn

unread,
Jun 5, 2022, 3:49:45 PM6/5/22
to sage-cell
Update: That is working when all components are rendered at startup time, but not when components are added later - the new component cannot see the sagecell object.initially loaded at the top level. 
It might be easier if embedded_sagecell.js would be available as a module. 

Ingo Dahn

unread,
Jun 5, 2022, 4:19:33 PM6/5/22
to sage-cell
Update: I can load the existing embedded_sagecell.js in a second script tag in a component - contradicting any style guide, but it is working

Andrey Novoseltsev

unread,
Jun 5, 2022, 4:49:33 PM6/5/22
to sage-cell
What exactly do you mean by a module here?

Since we need to support older pages, we cannot alter the way how embedded_sagecell.js is supposed to be loaded. But in principle it is possible to serve a script with a different name that uses some other approach.

Ingo Dahn

unread,
Jun 5, 2022, 6:32:35 PM6/5/22
to Andrey Novoseltsev, sage-cell
I mean javascript modules as in Modules, introduction (javascript.info) such that other Javascript files can use the sagecell object through
import { sagecell } from "..."
The module could be provided under a different URL and wouldn't conflict with the js file. Ideally it would be self-contained.


Andrey Novoseltsev wrote:


What exactly do you mean by a module here?

Since we need to support older pages, we cannot alter the way how embedded_sagecell.js is supposed to be loaded. But in principle it is possible to serve a script with a different name that uses some other approach.

--
You received this message because you are subscribed to a topic in the Google Groups "sage-cell" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sage-cell/nM-vk761RsI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sage-cell+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sage-cell/fe6e6286-566b-4898-9535-5677a2e9e49an%40googlegroups.com.

Andrey Novoseltsev

unread,
Jun 12, 2022, 3:43:17 PM6/12/22
to sage-cell
Do you think that we should use module interface by default? 

I.e. we keep embedded_sagecell.js forever, but switch current instructions for new pages to using modules, say with the name sagecell.js (not sure why we ever had to add "embedded" anyway ;-))

It seems that having a guarantee that modules execute only once as well as waiting till the page is fully formed  would make internal logic a bit cleaner. Although of course we still have to support the old approach.
Reply all
Reply to author
Forward
0 new messages