Open Arpita-Jaiswal opened 1 year ago
How about both js:
and js-module:
. What possible values we can pass to type
?
As per MDN, the possible values of type
are module
, importmap
, blocking
, and any valid content type can be used as type if the content of script tag is not meant to be JavaScript.
For our purpose only type: module
is relevant. So we will do js
and js-module
.
we can use some other alternatives like
syntax 1) -- ftd.text: Hello js: src:bar.js module
Here we have use colon (:) to separate the key-value pairs. The src key represents the source file (bar.js), and the module key indicates the module type.
syntax 2) -- ftd.text: Hello js: bar.js(module)
source file (bar.js) followed by the module type (module).
To include the HTTP or HTTPS protocol in the link while using the simplified syntax
We have one more option:
js: https://anything.com/bar.js as module
that would be more simple and easy to understand
Why don't you take a stab at implementing it @HarshikaAdarsh? Should not be too easy. If you are interested you can come say hello on our discord, #fastn-contributors
channel and we can guide you more.
@amitu @Arpita-Jaiswal Let me work on this issue
Currently, the syntax to pass value in
js
is:Problems:
http
orhttps
protocol in the link.The below code will not work:
So we need to remove
http
orhttps
protocol from the link.Therefore, we need a better syntax for this.
Some suggestions for new syntax
Syntax 1:
Syntax 2:
We are open for any syntax suggestions