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

refactor(git): make git plugin usable on browser #189

Closed
wants to merge 7 commits into from

Conversation

matteo-cristino
Copy link
Collaborator

This still does not work, when adding @slangroom/git to @slangroom/browser I get:

Uncaught Error: Dynamic require of "fs" is not supported

maybe we should use BrowserFS instaead of fs?

Or even lightning-fs from the autors of isomorphic-git

for the moment will leave it here as a draft, to be worked on when we have time

@matteo-cristino matteo-cristino marked this pull request as draft August 8, 2024 13:28
@puria
Copy link
Member

puria commented Aug 11, 2024

This still does not work, when adding @slangroom/git to @slangroom/browser I get:

Uncaught Error: Dynamic require of "fs" is not supported

maybe we should use BrowserFS instaead of fs?

Or even lightning-fs from the autors of isomorphic-git

go for it... lightning-fs seems very promising!

@matteo-cristino
Copy link
Collaborator Author

Looking better at lightning-fs it seems that it works just in the browser and thus it is not isomoprhic. This left us with ZenFS that is the active fork of BrowserFS

@matteo-cristino
Copy link
Collaborator Author

Now fs and path should have been fixed, waiting for a new zenFS release that fix a bug to continue on tests.

But I found out another thing that is that also process is not define on the browser, where we use it to get the env variables in @slangroom/git

export const sandboxDir = () => {
	// TODO: sanitize sandboxDir
	return process.env['FILES_DIR'];
};

Will continue on next week to see what can be done for this 🫠

@matteo-cristino
Copy link
Collaborator Author

superseded by #195

@matteo-cristino matteo-cristino deleted the feat/browser branch August 28, 2024 13:11
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

Successfully merging this pull request may close these issues.

2 participants