Skip to content
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

Packaging of REPL or make it more customizable. #185

Open
kant2002 opened this issue Sep 11, 2023 · 1 comment
Open

Packaging of REPL or make it more customizable. #185

kant2002 opened this issue Sep 11, 2023 · 1 comment

Comments

@kant2002
Copy link
Contributor

kant2002 commented Sep 11, 2023

I working on localization for REPL for my own needs. I plan to support couple languages which I can manage myself, and couple others based on Google Translate. Instead of working with patches, I interested into adding at least translation to this project. I think this is both improve REPL with relatively small amount of work to maintain and help me directly.

Because it's published currently under different domain I have to patch these lines

repl/src/App/Prelude.fs

Lines 13 to 19 in 081d22a

let HOST =
#if DEBUG
// "http://localhost:8080"
Browser.Dom.window.location.href
#else
"https://fable.io/repl/"
#endif

I don't really understand why not use Browser.Dom.window.location.href both for Debug and Release configurations.

Other options for customization which I would like to have is being able to specify list of additional assemblies here

repl/src/App/Prelude.fs

Lines 29 to 39 in 081d22a

let EXTRA_REFS =
[|"Browser.Blob"
"Browser.Event"
"Browser.WebStorage"
"Browser.Dom"
"Browser.WebGL"
"Browser.Css"
"Browser.MediaQueryList"
"Browser.Gamepad"
"Fable.Repl.Lib"
|]

again, this is probably not big deal, but I think this may be valuable for REPL too.

So I really would like to hear what users and maintainers thinking about all these ideas.

@MangelMaxime
Copy link
Member

I don't really understand why not use Browser.Dom.window.location.href both for Debug and Release configurations.

I don't remember for what we are using the HOST variable, but using window.location.href means that if the user clicked on the share button it will return something of the form https://fable.io/repl/#?code=DYUwLgBAHhC8ECIFA&html=Q&css=Q and not just the https://fable.io/repl/ portion.

So replacing with window.location.href all the time is probably not enough.

Regarding the additional assemblies, it is important to note that Fable REPL since Fable 3, only supports pure bindings. So it is not possible to use Fable libraries. Alfonso planned to re-add support for that in the past, but I don't think this has been done unfortunately.

And it also require the DLLs to be generated using a specific fork of the F# compiler. All that to say, that adding Fable libraries to the repl is not that easy currently unfortunately.

There are others issues discussing the ability to make Fable REPL a component or services like #70. Perhaps, there are ideas in them.

I am currently in the process of modernising Fable infrastructure to make it easier to contribute. The REPL is one of the element, I want to improve but unfortunately it is at the end of the chain right now...


Regarding, the possibility to add translation to the REPL we can consider doing it inside of this repository directly. We can do it in a naive way using a record to store the information.

kant2002 added a commit to kant2002/repl that referenced this issue Sep 16, 2023
This is based on suggestions from fable-compiler#185

I have translation for Ukrainian and Russian, but want to gather feedback on the approach.
I think that's it, and no additional strings needed, or that amount would be very small.

I have to add dependency on Fable.Browser.Navigator since tha allow account for user preferences.
MangelMaxime pushed a commit to kant2002/repl that referenced this issue Jan 1, 2024
This is based on suggestions from fable-compiler#185

I have translation for Ukrainian and Russian, but want to gather feedback on the approach.
I think that's it, and no additional strings needed, or that amount would be very small.

I have to add dependency on Fable.Browser.Navigator since tha allow account for user preferences.
MangelMaxime added a commit that referenced this issue Jan 1, 2024
Add infrastructure to be able translate REPL This is based on suggestions from #185
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants