dumberjs / dumber-gist

A lightweight online IDE to write JS SPA prototypes in your own GitHub gists.
https://gist.dumber.app
MIT License
28 stars 2 forks source link

Question : dumber-gist with custom framework (based on aurelia) #29

Closed miniben-90 closed 4 years ago

miniben-90 commented 4 years ago

Hello,

We're trying to use your project with a custom framework based on aurelia. We have changed the registry (using a private registery) and cdn. But when we try to use my custom template after defined it on package template it try to load aurelia from cdn. after change registry and cdn targets, what need to be changed to make it works with your sandbox project?

ps : to be clear we need to inject our compiled project into dist/entry-bundle.js but I don't know where and how to do it.

Best regards.

3cp commented 4 years ago

Honestly, it's quite hard to cipher your question. 😅

I am guessing:

  1. you forked this repo, and try to run it locally.
  2. you updated https://registry.npmjs.cf to your own private registery.
  3. you replaced jsdelivr cdn with yours.

I don't understand other parts:

when we try to use my custom template after defined it on package template it try to load aurelia from cdn.

we need to inject our compiled project into dist/entry-bundle.js

miniben-90 commented 4 years ago

Hello, thanks for your quick answer.

Yes I forked your repo localy and replaced registry and jsdelivr with our informations.

In your aurelia template you define <script src="/dist/entry-bundle.js" data-main="aurelia-bootstrapper"></script> but in our structure we define a compiled dependencies who include all Aurelia deps. But when I replace /dist/entry-bundle.js with the cdn path of our deps it try to load main.js from the cdn. So how I can inject my framework into entry-bundle?

Best regards.

3cp commented 4 years ago

There is nothing you can do with entry-bundle, it is all sealed in dumber-gist without exposing any configuration.

When writing prototype in the web app, update package.json to use your framework. But your framework will have trouble because it's based on aurelia. Aurelia is convention based, there is a special tracer in the app to support aurelia.

Dumber doesn't know what to do with your framework. Without knowing the detail of your framework (A wrapper, or modified, or subser, or superset), I have no valid suggestion.

For other frameworks like react, no special tracer needed (besides jsx support), they just work

Customizing at framework is also bit strange way to meet business requirements. The AMD loader environment (which dumber bundles into every app) is already very flexible and adoptive. There are quite a few tricks you can do at app runtime.

3cp commented 4 years ago

@aegenet are you guys on same team?

aegenet commented 4 years ago

Yes, we have a software platform based on Aurelia (since 2016). I asked @miniben-90 to analyze the use of gist.dumber.app with our libraries. Currently he is working on the private cdn/data part (only used when a package is from a private npm, otherwise it fallback on the classic cdn, like a proxy).

I hope we will find out a solution that will be usable without this private cdn.

3cp commented 4 years ago

Lovely!