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

Add the canvas file to Devtools on compile #51

Closed
pichoemr opened this issue Mar 3, 2022 · 10 comments · May be fixed by #74
Closed

Add the canvas file to Devtools on compile #51

pichoemr opened this issue Mar 3, 2022 · 10 comments · May be fixed by #74
Assignees
Labels
enhancement New feature or request

Comments

@pichoemr
Copy link
Contributor

pichoemr commented Mar 3, 2022

Add the Canvas file https://unpkg.com/[email protected]/bin/canvaskit.js, on compile to allow work offline

@pichoemr pichoemr added the enhancement New feature or request label Mar 3, 2022
@Nesqwik Nesqwik moved this from 🟡 Backlog to ⚪ Todo in Lenra Mar 28, 2022
@jonas-martinez
Copy link
Collaborator

jonas-martinez commented Mar 28, 2022

flutter/flutter#92134 This PR was supposed to solve our problem. It seems that this was introduced on Flutter 2.10.0 but we just recently updated Flutter on our repositories. I'm checking if we are using the proper version of flutter when building the web folder.

EDIT

This PR only introduced a cache for the canvaskit file. This does not solve our problem.

It seems that the only way to solve this issue is to use an environment variable on --dart-define argument when running Flutter as explained here flutter/flutter#70101 (comment).

@jonas-martinez jonas-martinez moved this from ⚪ Todo to 🟢 In Progress in Lenra Mar 28, 2022
@jonas-martinez jonas-martinez self-assigned this Mar 28, 2022
@jonas-martinez jonas-martinez moved this from 🟢 In Progress to 🔵 In Review in Lenra Mar 28, 2022
@Nesqwik
Copy link
Member

Nesqwik commented Apr 13, 2022

So according to the discussion int the PR #74, this is an issue that flutter could fix in the future. For now there is a workaround that could break anytime if flutter change the way canvaskit is handled.

@taorepoara should we apply the workaround for now or should we just wait until Flutter provide a "native" fix ?

@Nesqwik
Copy link
Member

Nesqwik commented May 23, 2022

Check Flutter V3 and fix for this version if not implemented natively

@jonas-martinez jonas-martinez moved this from 🔵 In Review to 🟢 In Progress in Lenra May 30, 2022
@jonas-martinez
Copy link
Collaborator

@lenra-io/devs Does someone remember how to replicate this issue locally ? I tried to launch the devtools while offline, it seems to be working.

@taorepoara
Copy link
Member

@lenra-io/devs Does someone remember how to replicate this issue locally ? I tried to launch the devtools while offline, it seems to be working.

I had the problem when I was offline and using the devtool Docker image. I can try to see if the problem remains.

@taorepoara
Copy link
Member

Reproduced with incognito window.

@jonas-martinez
Copy link
Collaborator

According to this comment on a Flutter issue flutter/flutter#60069 (comment), canvaskit is bundled with the app when you run flutter build web.
I tried to replicate this behavior locally and I found the canvaskit files inside of the build/web/canvaskit folder. This is good news !
To make it work we might want to combine the fact that canvaskit exists in build/web/canvaskit and that we can specify specific canvaskit path when running the app by adding --dart-define=FLUTTER_WEB_CANVASKIT_URL=path/to/canvaskit to the command.

@jonas-martinez
Copy link
Collaborator

It seems that the --dart-define=FLUTTER_WEB_CANVASKIT_URL=path/to/canvaskit option is not working properly. Another solution is to change the value of the canvaskit url from the index.html file in the web folder according to this comment flutter/flutter#94264 (comment).

@jonas-martinez jonas-martinez moved this from 🟢 In Progress to 🔵 In Review in Lenra Jun 7, 2022
@Nesqwik
Copy link
Member

Nesqwik commented Jun 7, 2022

It seems that the --dart-define=FLUTTER_WEB_CANVASKIT_URL=path/to/canvaskit option is not working properly. Another solution is to change the value of the canvaskit url from the index.html file in the web folder according to this comment flutter/flutter#94264 (comment).

Accoriding to the post you linked, the fonts are not working out of the box. But if we follow the link in your comment, we have this : flutter/flutter#60069 (comment)

We should probably wait until it's officially done instead of workaround... What do you think @jonas-martinez ? @taorepoara ?

@jonas-martinez
Copy link
Collaborator

In my opinion we might not absolutely need this feature. We can wait for Flutter to do the fix on their side, which was planned for Q1 2022 so it might come soon.

@Nesqwik Nesqwik moved this from 🔵 In Review to 🔴 Blocked in Lenra Jul 4, 2022
@github-project-automation github-project-automation bot moved this from 🔴 Blocked to ⚫ Done in Lenra Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants