1
00:00:00,580 --> 00:00:04,689
The next little optimization that we're going to make is going to be to improve our unresolved function.

2
00:00:04,960 --> 00:00:09,730
So, again, we've got this hardcoded check to look for an exact path of tiny test package.

3
00:00:10,190 --> 00:00:14,500
That means that we can only ever import just that package off of the unpackaged website.

4
00:00:15,040 --> 00:00:20,470
So we're going to make sure small change here that if we ever tried to import a file with a path other

5
00:00:20,470 --> 00:00:26,680
than index stocks, we're going to assume that is going to be some module posted at unpackaged dot com

6
00:00:27,070 --> 00:00:28,240
will then start to generate that.

7
00:00:28,240 --> 00:00:33,340
You are dynamically we're going to first once again do this in a somewhat naive fashion, realize that

8
00:00:33,340 --> 00:00:36,640
it doesn't quite work in some scenarios, and then come back and make some changes to it.

9
00:00:37,370 --> 00:00:42,760
They're going to first begin by commenting out all of that case like.

10
00:00:42,760 --> 00:00:45,880
So I'll keep it around for just a moment just in case we need to refer back to it.

11
00:00:47,090 --> 00:00:53,180
So then if we ever have a unresolved call file with a path other than index dogs.

12
00:00:54,260 --> 00:00:59,630
I'm going to immediately return an object again, give it a namespace of those names, faces are eventually

13
00:00:59,630 --> 00:01:02,300
going to be relevant, by the way, not just yet, but they will eventually.

14
00:01:03,370 --> 00:01:09,760
And then we will put in a path for right now that is going to be a template string will put in colon

15
00:01:10,450 --> 00:01:14,020
slash, unpackaged dot com slash.

16
00:01:14,950 --> 00:01:21,520
And then thylacine curly braces and then the package name, which is essentially just our exact path,

17
00:01:22,360 --> 00:01:24,880
we'll put in args dot pat like so.

18
00:01:25,960 --> 00:01:31,330
Now, just to be precise, that is eventually just going to give us a whirl of something like that right

19
00:01:31,330 --> 00:01:31,600
there.

20
00:01:32,250 --> 00:01:36,490
So this is eventually going to cause us a little bit of problems, but it's going to work for right

21
00:01:36,490 --> 00:01:36,730
now.

22
00:01:38,440 --> 00:01:40,810
OK, so let's say this vile.

23
00:01:42,020 --> 00:01:43,070
Go back over to the browser.

24
00:01:44,280 --> 00:01:45,390
I'm going to refresh again.

25
00:01:46,380 --> 00:01:49,140
Zimet Yup, looks like it all still works.

26
00:01:50,310 --> 00:01:53,010
So I did just mention that, hey, this isn't always going to work.

27
00:01:54,050 --> 00:01:58,670
Let's take another pause, come back in next video and start to see where this approach starts to fall

28
00:01:58,670 --> 00:01:59,050
apart.

