-
Notifications
You must be signed in to change notification settings - Fork 50
Update client to PureScript 0.15.2 #278
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
Merged
JordanMartinez
merged 9 commits into
purescript:master
from
JordanMartinez:update-client
Jun 10, 2022
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
27a00ed
Update package set to latest; drop globals/math
JordanMartinez cff048f
Update client code to PS 0.15.2
JordanMartinez f072566
Move jquery code to Container.js FFI
JordanMartinez cc2cadb
Bundle code via esm
JordanMartinez e181afe
Add changelog entry
JordanMartinez 073c61b
Run bundle command in CI
JordanMartinez 63342e0
Add esbuild to list of dependencies
JordanMartinez 22a4bac
Add blank line
JordanMartinez c2affa0
Hack around error issue using encodeJson
JordanMartinez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,4 @@ cabal.sandbox.config | |
*.lksh* | ||
bundle/ | ||
client/public/js/output | ||
client/client.js |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,5 @@ | ||
let upstream = | ||
https://github.com/purescript/package-sets/releases/download/psc-0.13.6-20200404/packages.dhall sha256:f239f2e215d0cbd5c203307701748581938f74c4c78f4aeffa32c11c131ef7b6 | ||
https://github.com/purescript/package-sets/releases/download/psc-0.15.2-20220609/packages.dhall | ||
sha256:2b15922dcc47143e5f271a75d4aa91b0379bc1bd7d880adfb428e287617210f7 | ||
|
||
let additions = | ||
{ ace = | ||
{ repo = "https://github.com/purescript-contrib/purescript-ace.git" | ||
, version = "v7.0.0" | ||
, dependencies = | ||
[ "arrays" | ||
, "console" | ||
, "effect" | ||
, "foreign" | ||
, "nullable" | ||
, "prelude" | ||
, "refs" | ||
, "web-html" | ||
, "web-uievents" | ||
] | ||
} | ||
} | ||
|
||
in upstream // additions | ||
in upstream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,59 @@ | ||
"use strict"; | ||
$.ajaxSetup({ | ||
dataType: "text", | ||
}); | ||
|
||
exports.setupIFrame = setupIFrame; | ||
exports.teardownIFrame = teardownIFrame; | ||
export function teardownIFrame() { | ||
var $ctr = $("iframe#output-iframe"); | ||
$ctr.remove() | ||
} | ||
|
||
export function setupIFrame(data, loadCb, failCb) { | ||
var $ctr = $("#column2"); | ||
var $iframe = $( | ||
'<iframe sandbox="allow-scripts allow-forms" id="output-iframe" src="frame.html">' | ||
); | ||
$ctr.empty().append($iframe); | ||
var tries = 0; | ||
|
||
var sendSources = setInterval(function () { | ||
// Stop after 10 seconds | ||
if (tries >= 100) { | ||
return clearInterval(sendSources); | ||
} | ||
tries++; | ||
var iframe = $iframe.get(0).contentWindow; | ||
if (iframe) { | ||
iframe.postMessage(data, "*"); | ||
loadCb(); | ||
} else { | ||
failCb(); | ||
console.warn("Frame is not available"); | ||
} | ||
}, 100); | ||
|
||
window.addEventListener( | ||
"message", | ||
function () { | ||
clearInterval(sendSources); | ||
}, | ||
{ once: true } | ||
); | ||
|
||
window.addEventListener("message", function (event) { | ||
if ( | ||
event.data && | ||
event.data.githubId | ||
) { | ||
window.location.search = "github=" + event.data.githubId; | ||
} | ||
if ( | ||
event.data && | ||
event.data.gistId && | ||
/^[0-9a-f]+$/.test(event.data.gistId) | ||
) { | ||
window.location.search = "gist=" + event.data.gistId; | ||
} | ||
}); | ||
|
||
return $iframe; | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
encodeJson
FTW! 😄