Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
c8a00057
Commit
c8a00057
authored
Dec 21, 2020
by
aniket-engg
Committed by
Aniket
Jan 04, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
handlers loaded from remix-url-resolver
parent
672a662a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
7 deletions
+16
-7
compiler-imports.js
apps/remix-ide/src/app/compiler/compiler-imports.js
+14
-6
index.ts
libs/remix-url-resolver/src/index.ts
+1
-1
resolve.ts
libs/remix-url-resolver/src/resolve.ts
+1
-0
No files found.
apps/remix-ide/src/app/compiler/compiler-imports.js
View file @
c8a00057
'use strict'
import
{
Plugin
}
from
'@remixproject/engine'
import
*
as
packageJson
from
'../../../../../package.json'
import
{
RemixURLResolver
}
from
'@remix-project/remix-url-resolver'
const
remixTests
=
require
(
'@remix-project/remix-tests'
)
const
globalRegistry
=
require
(
'../../global/registry'
)
const
addTooltip
=
require
(
'../ui/tooltip'
)
...
...
@@ -79,6 +80,7 @@ module.exports = class CompilerImports extends Plugin {
}
handleHttpCall
(
url
,
cleanUrl
,
cb
)
{
console
.
log
(
'Inside ide handleHttpCall'
)
return
request
.
get
(
{
url
...
...
@@ -136,7 +138,7 @@ module.exports = class CompilerImports extends Plugin {
if
(
imported
)
{
return
cb
(
null
,
imported
.
content
,
imported
.
cleanUrl
,
imported
.
type
,
url
)
}
var
handlers
=
this
.
h
andlers
()
var
handlers
=
new
RemixURLResolver
().
getH
andlers
()
var
found
=
false
handlers
.
forEach
(
function
(
handler
)
{
...
...
@@ -149,18 +151,24 @@ module.exports = class CompilerImports extends Plugin {
found
=
true
loadingCb
(
'Loading '
+
url
+
' ...'
)
handler
.
handler
(
match
,
function
(
err
,
content
,
cleanUrl
)
{
if
(
err
)
{
cb
(
'Unable to import "'
+
cleanUrl
+
'": '
+
err
)
return
}
handler
.
handle
(
match
).
then
(
function
(
content
)
{
self
.
previouslyHandled
[
url
]
=
{
content
:
content
,
cleanUrl
:
cleanUrl
,
type
:
handler
.
type
}
cb
(
null
,
content
,
cleanUrl
,
handler
.
type
,
url
)
}).
catch
(
function
(
error
)
{
cb
(
'Unable to import "'
+
cleanUrl
+
'": '
+
error
)
return
})
// function (err, content, cleanUrl) {
// if (err) {
// }
// })
}
})
if
(
found
)
return
...
...
libs/remix-url-resolver/src/index.ts
View file @
c8a00057
export
*
from
'./resolve'
export
{
RemixURLResolver
}
from
'./resolve'
libs/remix-url-resolver/src/resolve.ts
View file @
c8a00057
...
...
@@ -42,6 +42,7 @@ export class RemixURLResolver {
* @params cleanURL
*/
async
handleHttp
(
url
:
string
,
_
:
string
)
{
console
.
log
(
'Inside libs handleHttpCall'
)
//eslint-disable-next-line no-useless-catch
try
{
const
response
:
AxiosResponse
=
await
axios
.
get
(
url
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment