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

feat: support monaco editor offline usage and most fabric fonts offline display #5547

Closed
wants to merge 12 commits into from

Conversation

liweitian
Copy link
Contributor

@liweitian liweitian commented Jan 18, 2021

Description

Composer cannot use offline now due to monaco editor code and fabric fonts need to be downloaded from CDN.

This PR will copy needed resouce to public folder during build time.
FYI, https://fabricui.com/react/styles/icons suren-atoyan/monaco-react#12

And from online discussion, one person said the fonts in public folder does not include all fonts, although this is not agreed by the fabric UI engineers and I did not find any font not showing in composer.

Task Item

#minor

Screenshots

The is tested without network
offline

@coveralls
Copy link

coveralls commented Jan 18, 2021

Coverage Status

Coverage remained the same at 55.087% when pulling cd47444 on offlineUsage into 7185fb4 on main.

@hatpick
Copy link
Contributor

hatpick commented Jan 19, 2021

Why do we need all these other files (objective-c, python, php, etc.) ?

@a-b-r-o-w-n
Copy link
Contributor

Is it possible to add some steps to our client build that fetches these files and then ignore them in the repo?

@liweitian liweitian changed the title feat: support monaco editor offline usage and most fabric fonts offline diplay feat: support monaco editor offline usage and most fabric fonts offline display Jan 20, 2021
@liweitian
Copy link
Contributor Author

Is it possible to add some steps to our client build that fetches these files and then ignore them in the repo?

Done. This pr is ready for another review.

const fabricFonts = path.resolve(__dirname, '../../../node_modules/@uifabric/icons/fonts');
const fabricFontsInPublicFolder = path.resolve(__dirname, '../public/fonts');
fs.copySync(fabricFonts, fabricFontsInPublicFolder);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doing this as part of the prod build only seems like it would break local development. Is that true? I was thinking it should happen as a postinstall script.

@a-b-r-o-w-n
Copy link
Contributor

@liweitian what is the status of this work? It seems to have stalled and there is some other work regarding monaco. Please close this PR if it is no longer needed. I will close in a few days if no activity.

@a-b-r-o-w-n a-b-r-o-w-n closed this Jun 7, 2021
@a-b-r-o-w-n a-b-r-o-w-n reopened this Jun 7, 2021
@liweitian
Copy link
Contributor Author

Closed it for now since we are updating the version of monaco. I will open another pr if it is needed to solve issues on VMs cannot download monaco load.js from CDN

@liweitian liweitian closed this Jun 8, 2021
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.

5 participants