tradingview / charting-library-examples

Examples of Charting Library integrations with other libraries, frameworks and data transports
MIT License
1.32k stars 744 forks source link

[nextjs]: Fix typings of window. More strict typing for window #367

Open ssbarbee opened 6 months ago

ssbarbee commented 6 months ago

Add example checklist

Bug fix checklist

ssbarbee commented 6 months ago

@SlicedSilver do you mind reviewing this PR?

SlicedSilver commented 6 months ago

I think it would be better if we updated the example to import the datafeed class directly instead of loading it via a <script> tag which pollutes the global window scope.

I haven't tested this, but looking at the existing syntax I would expect something like this to work:

import { UDFCompatibleDatafeed } from "@/public/static/datafeeds/udf/src/udf-compatible-datafeed";
ssbarbee commented 6 months ago

I think it would be better if we updated the example to import the datafeed class directly instead of loading it via a <script> tag which pollutes the global window scope.

I haven't tested this, but looking at the existing syntax I would expect something like this to work:

import { UDFCompatibleDatafeed } from "@/public/static/datafeeds/udf/src/udf-compatible-datafeed";

Do you mind explaining to me about the Githubissues.

  • Githubissues is a development platform for aggregating issues.